From 1214b507c5ee02bae4ef04c82e525c5648196e01 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Wed, 3 Aug 2022 20:53:29 -0500 Subject: [PATCH] r/collectd-prometheus: Skip firewalld tasks Some machines, such as the nodes in the Kubernetes cluster, do not use *firewalld*. For these machines, we need to skip the `firewalld` tasks, as they will fail. The `host_uses_firewalld` variable can be set to `False` for these machines to do so. --- roles/collectd-prometheus/tasks/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/collectd-prometheus/tasks/main.yml b/roles/collectd-prometheus/tasks/main.yml index 653ac96..bc79ce2 100644 --- a/roles/collectd-prometheus/tasks/main.yml +++ b/roles/collectd-prometheus/tasks/main.yml @@ -40,6 +40,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 +49,5 @@ permanent: true immediate: false state: '{{ "enabled" if collectd_prometheus_allow_outside else "disabled" }}' + when: host_uses_firewalld|d(true)|bool tags: firewalld