From cb9497d76b22aaa8ad38c07183fbc551dbda3acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Jeanneret?= Date: Mon, 15 Apr 2019 13:32:33 +0200 Subject: [PATCH] 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 --- deployment/haproxy/haproxy-container-puppet.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/haproxy/haproxy-container-puppet.yaml b/deployment/haproxy/haproxy-container-puppet.yaml index 6d8df792ee..2ade745055 100644 --- a/deployment/haproxy/haproxy-container-puppet.yaml +++ b/deployment/haproxy/haproxy-container-puppet.yaml @@ -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