From 2d4430bd7188a7ae49a8cdb15b1dd546b46c7de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Jeanneret?= Date: Thu, 27 Jun 2019 07:21:11 +0200 Subject: [PATCH] Avoid checking rc if we're in dry-run mode Currently running `ansible --check' against generated playbook fails because the "exec" won't be done, hence the registered resource won't get the "rc" entry. Change-Id: Ic8001d4fd8c489f10c565d05ae82060fa3fb6ce8 Closes-Bug: #1834409 --- deployment/iscsid/iscsid-container-puppet.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deployment/iscsid/iscsid-container-puppet.yaml b/deployment/iscsid/iscsid-container-puppet.yaml index 5d6b69a422..00d6d2433a 100644 --- a/deployment/iscsid/iscsid-container-puppet.yaml +++ b/deployment/iscsid/iscsid-container-puppet.yaml @@ -117,7 +117,9 @@ outputs: register: iscsi_service_enabled_result - name: Stop iscsi.service service: name=iscsi.service state=stopped enabled=no - when: iscsi_service_enabled_result.rc == 0 + when: + - iscsi_service_enabled_result is changed + - iscsi_service_enabled_result.rc == 0 upgrade_tasks: [] post_upgrade_tasks: - when: step|int == 1