From 35088487c265eb153693a13179a39ac07a495f4f Mon Sep 17 00:00:00 2001 From: Quique Llorente Date: Fri, 28 Sep 2018 09:42:12 +0200 Subject: [PATCH] Add a fact checking xinetd service present Upgrade rocky->master was failing at service xinetd missing Change-Id: I5864ea4ba7364834ed7b47de64674ade87719e2e --- docker/services/xinetd.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docker/services/xinetd.yaml b/docker/services/xinetd.yaml index 7803052ef2..07aa4040ca 100644 --- a/docker/services/xinetd.yaml +++ b/docker/services/xinetd.yaml @@ -47,9 +47,24 @@ outputs: config_image: '' config_settings: {} upgrade_tasks: + - when: step|int == 0 + tags: common + block: + - name: Check if xinetd service is deployed + ignore_errors: True + command: systemctl is-enabled --quiet xinetd + register: xinetd_enabled_result + - name: Set fact xinetd_enabled + set_fact: + xinetd_enabled: "{{ xinetd_enabled_result.rc == 0 }}" + - name: "PreUpgrade step0,validation: Check if xinetd is running" + command: systemctl is-active --quiet xinetd + when: xinetd_enabled|bool + tags: validation - when: step|int == 2 block: - name: stop and deactivate xinetd service + when: xinetd_enabled|bool service: name: xinetd state: stopped