Restart only installed services
Avoids deployment failure while doing the restart of services when rsyslog was not installed. Failure was found while attempting a standalone deployment on a fresh RHEL8 host. Change-Id: I286029011e36dd35411987c7918916f8082d885b
This commit is contained in:
parent
3d0b499bae
commit
58a9f97a9e
@ -48,11 +48,15 @@ outputs:
|
||||
timezone:
|
||||
name: "{{ timezone }}"
|
||||
register: timezone_result
|
||||
- name: Populate service facts
|
||||
service_facts:
|
||||
- name: Restart services
|
||||
when:
|
||||
- timezone_result.changed
|
||||
- (item + ".service") in ansible_facts.services
|
||||
service:
|
||||
name: "{{ item }}"
|
||||
state: restarted
|
||||
with_items:
|
||||
- rsyslog
|
||||
- crond
|
||||
when: timezone_result.changed
|
||||
|
Loading…
x
Reference in New Issue
Block a user