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:
Logan V 2020-05-13 12:36:38 -05:00
parent d8b0b15d5a
commit 38db41fbd6
1 changed files with 7 additions and 0 deletions

View File

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