Skip to content

Commit

Permalink
Add firewall rule to include Kepler port
Browse files Browse the repository at this point in the history
Without this rule prometheus cannot scrape kepler metrics.
  • Loading branch information
yadneshk committed Nov 8, 2024
1 parent 0664c6f commit 85816fa
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,14 @@
state: directory
mode: "0775"

- name: Create /run/libvirt directory
- name: Create firewall directory
become: true
ansible.builtin.file:
path: "/run/libvirt"
path: "/var/lib/edpm-config/firewall"
state: directory
mode: "0775"

- name: Create libvirt user
become: true
command: groupadd libvirt
owner: root
group: root
mode: '0750'

- name: Create ceilometer.conf
become: true
Expand Down
9 changes: 0 additions & 9 deletions roles/edpm_telemetry_power_monitoring/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,6 @@
loop:
- {"src": "ceilometer-host-specific.conf.j2", "dest": "ceilometer-host-specific.conf"}

- name: Configure ceilometer user and group on the host
ansible.builtin.import_role:
name: edpm_users
vars:
edpm_users_users:
# 42405 is matching with the uid and gid created by kolla in the ceilometer containers
- {"name": "ceilometer", "uid": "42405", "gid": "42405", "shell": "/sbin/nologin", "comment": "ceilometer user", "groups": "libvirt"}
edpm_users_extra_dirs: []

- name: Gather ceilometer config files
ansible.builtin.set_fact:
configs:
Expand Down
3 changes: 3 additions & 0 deletions roles/edpm_telemetry_power_monitoring/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@

- name: Install telemetry power monitoring services
ansible.builtin.import_tasks: install.yml

- name: Post-install
ansible.builtin.include_tasks: post-install.yml
26 changes: 26 additions & 0 deletions roles/edpm_telemetry_power_monitoring/tasks/post-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
- 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 kepler firewall config
become: true
ansible.builtin.template:
src: "firewall.yaml.j2"
dest: "/var/lib/edpm-config/firewall/kepler.yaml"
mode: "0640"

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

- name: Reload firewall for kepler
ansible.builtin.include_role:
name: osp.edpm.edpm_nftables
tasks_from: "run.yml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# Generated via edpm_telemetry_power_monitoring
- rule_name: 000 Allow Kepler traffic
rule:
proto: tcp
dport:
- "8888"

0 comments on commit 85816fa

Please sign in to comment.