Browse Source

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
changes/33/672033/6
Sorin Sbarnea 2 years ago
parent
commit
58a9f97a9e
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      deployment/time/timezone-baremetal-ansible.yaml

+ 5
- 1
deployment/time/timezone-baremetal-ansible.yaml View File

@ -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…
Cancel
Save