Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Restart only installed services
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ssbarnea committed Jul 23, 2019
1 parent 3d0b499 commit 58a9f97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deployment/time/timezone-baremetal-ansible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 58a9f97

Please sign in to comment.