Correct error catching while in "--check" mode

When we're in "--check" mode with Ansible, the variable is defined,
but its content doesn't match the one we might get when actually applying
the run.
The right way to detect that is to check if the variable is changed.

In "--check", it is not changed, meaning we can't get the "rc" attribute.

I5851dc7820fdcc4f5790980d94b81622ce3b0c8d didn't do the right check, and
does not improve the situation.

Change-Id: I77c655addd0fe01948584fb43ba24d5b24ff330e
Related-Bug: #1823841
This commit is contained in:
Cédric Jeanneret 2019-04-15 13:32:33 +02:00
parent b4454024f7
commit cb9497d76b
1 changed files with 1 additions and 1 deletions

View File

@ -323,7 +323,7 @@ outputs:
shell: systemctl is-active rsyslog
register: rsyslog_config
- when:
- rsyslog_config is defined
- rsyslog_config is changed
- rsyslog_config.rc == 0
block:
- name: Forward logging to haproxy.log file