diff --git a/roles/collectd-prometheus/tasks/main.yml b/roles/collectd-prometheus/tasks/main.yml index 653ac96..d875338 100644 --- a/roles/collectd-prometheus/tasks/main.yml +++ b/roles/collectd-prometheus/tasks/main.yml @@ -21,6 +21,7 @@ dest: /var/lib/selinux/collectd-local.pp notify: - install collectd-local selinux module + when: ansible_selinux.status == 'enabled' tags: - selinux @@ -40,6 +41,7 @@ permanent: false immediate: true state: '{{ "enabled" if collectd_prometheus_allow_outside else "disabled" }}' + when: host_uses_firewalld|d(true)|bool tags: firewalld - name: ensure firewall is configured for collectd write_prometheus plugin @@ -48,4 +50,5 @@ permanent: true immediate: false state: '{{ "enabled" if collectd_prometheus_allow_outside else "disabled" }}' + when: host_uses_firewalld|d(true)|bool tags: firewalld