From 04401e852df9a6fab407270d4df9c716f9e94da3 Mon Sep 17 00:00:00 2001 From: Attila Darazs Date: Wed, 14 Sep 2016 12:38:44 +0200 Subject: [PATCH] Fix ansible-lint errors in the role Also avoid displaying "failed" steps near the finishing of the deployment. This will be less confusing for newcomers who are using Quickstart. Change-Id: Icdd7fded6b8cac6f083e929b6aedb03cafc004d8 --- tasks/overcloud-status.yml | 13 ++++++------- tasks/post-deploy.yml | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tasks/overcloud-status.yml b/tasks/overcloud-status.yml index 1000f0a87..8567b0205 100644 --- a/tasks/overcloud-status.yml +++ b/tasks/overcloud-status.yml @@ -10,27 +10,26 @@ #/usr/bin/awk '/Stack overcloud CREATE_/ && /FAILED/{exit 1}' {{ deploy_log }} - name: Check overcloud deploy status - shell: > - ! /usr/bin/grep 'Stack overcloud CREATE_FAILED' {{ deploy_log }} + command: > + /usr/bin/grep 'Stack overcloud CREATE_FAILED' {{ deploy_log }} register: deploy_result - ignore_errors: true + failed_when: deploy_result.rc > 1 + changed_when: false - name: write out overcloud status to a file on the localhost shell: > echo '{ "overcloud_deploy_result": "failed" }' > "{{ local_working_dir }}/overcloud_deployment_result.json" delegate_to: localhost - when: deploy_result.rc != 0 + when: deploy_result.rc == 0 - name: write out overcloud status to a file on the localhost shell: > echo '{ "overcloud_deploy_result": "passed" }' > "{{ local_working_dir }}/overcloud_deployment_result.json" delegate_to: localhost - when: deploy_result.rc == 0 + when: deploy_result.rc == 1 - name: import deployment status from file include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json" - name: echo deployment_status debug: var=overcloud_deploy_result - - diff --git a/tasks/post-deploy.yml b/tasks/post-deploy.yml index 219368104..24b9925d3 100644 --- a/tasks/post-deploy.yml +++ b/tasks/post-deploy.yml @@ -11,4 +11,4 @@ shell: | {{ working_dir }}/overcloud-deploy-post.sh \ > {{ post_deploy_log }} 2>&1 - + changed_when: true