Skip to content

Commit

Permalink
Open node_exporter port so Prometheus can scrape
Browse files Browse the repository at this point in the history
  • Loading branch information
jlarriba authored and openshift-cherrypick-robot committed Nov 19, 2024
1 parent 52c6ce2 commit c1dd29d
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
9 changes: 9 additions & 0 deletions roles/edpm_telemetry/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@
- name: Create libvirt user
command: groupadd libvirt

- name: Create firewall directory
become: true
ansible.builtin.file:
path: "/var/lib/edpm-config/firewall"
state: directory
owner: root
group: root
mode: 0750

- name: Create ceilometer.conf
ansible.builtin.copy:
dest: "{{ edpm_telemetry_config_src }}/ceilometer.conf"
Expand Down
3 changes: 3 additions & 0 deletions roles/edpm_telemetry/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@

- name: Install telemetry metrics
ansible.builtin.import_tasks: install.yml

- name: Post-install
ansible.builtin.include_tasks: post-install.yml
41 changes: 41 additions & 0 deletions roles/edpm_telemetry/tasks/post-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
# Copyright 2023 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

- name: Ensure firewall directory is present
become: true
ansible.builtin.file:
path: "/var/lib/edpm-config/firewall/"
state: directory
owner: root
group: root
mode: '0750'

- name: Copy telemetry firewall config
become: true
ansible.builtin.template:
src: "firewall.yaml.j2"
dest: "/var/lib/edpm-config/firewall/telemetry.yaml"
mode: "0640"

- name: Configure firewall for the libvirt
ansible.builtin.include_role:
name: osp.edpm.edpm_nftables
tasks_from: "configure.yml"

- name: Reload firewall for new libvirt rules
ansible.builtin.include_role:
name: osp.edpm.edpm_nftables
tasks_from: "run.yml"
7 changes: 7 additions & 0 deletions roles/edpm_telemetry/templates/firewall.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# Generated via edpm_telemetry
- rule_name: 000 Allow node_exporter traffic
rule:
proto: tcp
dport:
- "9100"

0 comments on commit c1dd29d

Please sign in to comment.