Add a fact checking xinetd service present

Upgrade rocky->master was failing at service xinetd missing

Change-Id: I5864ea4ba7364834ed7b47de64674ade87719e2e
This commit is contained in:
Quique Llorente 2018-09-28 09:42:12 +02:00
parent e516e8bfec
commit 35088487c2

View File

@ -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