Skip to content
Snippets Groups Projects

fix node exporter with firewalld enabled

1 file
+ 13
0
Compare changes
  • Side-by-side
  • Inline
@@ -58,3 +58,16 @@
name: node_exporter
state: restarted
enabled: true
- name: Collect facts about system services
ansible.builtin.service_facts:
- name: Configure firewalld to allow prometheus
ansible.posix.firewalld:
port: "{{ node_exporter_port }}/tcp"
zone: public
state: enabled
permanent: true
when:
- "'firewalld.service' in ansible_facts.services"
- ansible_facts.services["firewalld.service"].state == "running"
Loading