From 74bd9d8a6b5b60c71967a3c3b11208faf7a8df84 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Wed, 4 Apr 2018 14:45:14 -0400 Subject: [PATCH] Allow exit code of 0 only for deployments All the hook scripts record 0 for success and non-zero for failure. hook-puppet.py already handles a successful return code of 0 or 2 for puppet and always writes a 0 as the return code to indicate success to the json status file[1]. [1] https://github.com/openstack/heat-templates/blob/master/hot/software-config/elements/heat-config-puppet/install.d/hook-puppet.py#L161 Change-Id: I7c6c5e6395dbcf049072ecb1228fc10f83f1db7f --- tripleo_common/templates/deployments.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tripleo_common/templates/deployments.yaml b/tripleo_common/templates/deployments.yaml index 1c01c72b3..d5313bfbc 100644 --- a/tripleo_common/templates/deployments.yaml +++ b/tripleo_common/templates/deployments.yaml @@ -25,7 +25,7 @@ path: /var/lib/heat-config/deployed/{{ deployment_uuid }}.json state: absent become: true - when: deployed_file_stat.stat.exists and previous_deployment_result.rc not in (0, 2) + when: deployed_file_stat.stat.exists and previous_deployment_result.rc != 0 - name: "Force remove deployed file for {{ item }}" file: @@ -51,7 +51,7 @@ - status_code: "{{ deployment_result.rc }}" tags: - output - failed_when: deployment_result.rc not in (0, 2) + failed_when: deployment_result.rc != 0 when: not ansible_check_mode - name: "Check-mode for Run deployment {{ item }}"