Test for rsyslog_all group before conditional

Roles that depend on the rsyslog_client role may not have rsyslog_all
servers setup - this will then fail as the group does not exist in the
inventory.

We should test whether the group exists, and skip if the group doesn't
exist or if the host is not in the group.

Change-Id: Ica4e2e5ab2cf7e433e2d8bff05c4bca70031a65d
This commit is contained in:
Andy McCrae 2017-02-28 11:22:31 +00:00
parent 931b04ed00
commit 8e6b89c230
1 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@
dest: "/etc/rsyslog.d/50-default.conf"
owner: "root"
group: "root"
when: inventory_hostname not in groups['rsyslog_all']
when: (groups['rsyslog_all'] is not defined) or (inventory_hostname not in groups['rsyslog_all'])
tags:
- rsyslog_client-install
notify:
@ -68,7 +68,7 @@
dest: "/etc/rsyslog.conf"
owner: "root"
group: "root"
when: inventory_hostname not in groups['rsyslog_all']
when: (groups['rsyslog_all'] is not defined) or (inventory_hostname not in groups['rsyslog_all'])
tags:
- rsyslog_client-config
notify: