From 0932318b85d4a8848fa6ee9aef96d474c507095b Mon Sep 17 00:00:00 2001 From: Louis Tu <92532497+tu1h@users.noreply.github.com> Date: Fri, 25 Aug 2023 10:05:17 +0800 Subject: [PATCH] fix not-found service error (#10391) Signed-off-by: tu1h --- contrib/os-services/roles/prepare/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/os-services/roles/prepare/tasks/main.yml b/contrib/os-services/roles/prepare/tasks/main.yml index 9d8881bbb..e95dcef15 100644 --- a/contrib/os-services/roles/prepare/tasks/main.yml +++ b/contrib/os-services/roles/prepare/tasks/main.yml @@ -12,7 +12,7 @@ state: stopped enabled: no when: - "'firewalld.service' in services" + "'firewalld.service' in services and services['firewalld.service'].status != 'not-found'" - name: Disable service ufw systemd: @@ -20,4 +20,4 @@ state: stopped enabled: no when: - "'ufw.service' in services" + "'ufw.service' in services and services['ufw.service'].status != 'not-found'"