From abdc245cebf2d2a74ee395c43ba9290deb792eb3 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Thu, 15 Nov 2018 21:56:11 +0100 Subject: [PATCH] infra: don't restart firewalld if unit is masked if firewalld.service systemd unit is masked, the handler will fail when trying to restart it. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1650281 (cherry picked from commit 63b9835cbb0510415a2d0077697a0107e2d6c4f3) Signed-off-by: Guillaume Abrioux --- roles/ceph-defaults/tasks/facts.yml | 3 +++ roles/ceph-infra/handlers/main.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/roles/ceph-defaults/tasks/facts.yml b/roles/ceph-defaults/tasks/facts.yml index 8c1ddf652..45d7bba6e 100644 --- a/roles/ceph-defaults/tasks/facts.yml +++ b/roles/ceph-defaults/tasks/facts.yml @@ -239,3 +239,6 @@ - ceph_current_status['servicemap'] is defined - ceph_current_status['servicemap']['services'] is defined - ceph_current_status['servicemap']['services']['rgw'] is defined + +- name: populate service facts + service_facts: diff --git a/roles/ceph-infra/handlers/main.yml b/roles/ceph-infra/handlers/main.yml index 5a9d52410..dc97de47b 100644 --- a/roles/ceph-infra/handlers/main.yml +++ b/roles/ceph-infra/handlers/main.yml @@ -4,3 +4,6 @@ name: firewalld state: restarted enabled: yes + when: + - ansible_facts['services']['firewalld.service'] is defined + - ansible_facts['services']['firewalld.service']['state'] != 'masked' \ No newline at end of file