Only restart rsyslog when it is installed
Task fails if the host/container does not have rsyslog present. We can just skip the restart if it is not installed. Change-Id: Ie4c9a42133c1f042c587cec48f53b4a87bd50952
This commit is contained in:
parent
d8b0b15d5a
commit
38db41fbd6
|
@ -26,12 +26,19 @@
|
|||
tags:
|
||||
- haproxy-general-config
|
||||
|
||||
- name: Get package facts
|
||||
package_facts:
|
||||
manager: auto
|
||||
listen: Restart rsyslog
|
||||
|
||||
- name: Restart rsyslog
|
||||
service:
|
||||
name: "rsyslog"
|
||||
state: "restarted"
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
when:
|
||||
- "'rsyslog' in ansible_facts.packages"
|
||||
|
||||
- name: Reload haproxy
|
||||
service:
|
||||
|
|
Loading…
Reference in New Issue