From 88f527e35308d4e34ffeb26f1f70f460c5870a73 Mon Sep 17 00:00:00 2001 From: Juan Badia Payno Date: Thu, 1 Dec 2022 20:07:52 +0100 Subject: [PATCH] Bug#1998501 fixed ansible conditional evaluation Not sure why but it seems to me that the parallel execution is affecting this conditional evaluation. As this conditional way was used in several places, this patch aims also to change those places to look alike. Closes-Bug: #1998501 Change-Id: Ib4de49adc50ee4c806882754c5657c7dbd1f8993 --- common/deploy-steps-tasks-step-0.yaml | 4 ++- common/deploy-steps.j2 | 40 ++++++++++++++++++++------- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/common/deploy-steps-tasks-step-0.yaml b/common/deploy-steps-tasks-step-0.yaml index c1fef68b94..747fef834d 100644 --- a/common/deploy-steps-tasks-step-0.yaml +++ b/common/deploy-steps-tasks-step-0.yaml @@ -41,4 +41,6 @@ - include_tasks: "{{ _task_file_path }}" vars: _task_file_path: "{{ tripleo_role_name }}/deploy_steps_tasks_step0.yaml" - when: playbook_dir ~ '/' ~ _task_file_path is exists + _full_file_path: "{{ playbook_dir }}/{{ _task_file_path }}" + _test_file_exists: "{{ _full_file_path is exists }}" + when: _test_file_exists | bool diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2 index 47544fccec..c3abfeb2ce 100644 --- a/common/deploy-steps.j2 +++ b/common/deploy-steps.j2 @@ -465,7 +465,9 @@ outputs: - include_tasks: "{{ _task_file_path }}" vars: _task_file_path: "external_deploy_steps_tasks_step0.yaml" - when: playbook_dir ~ '/' ~ _task_file_path is exists + _full_file_path: "{{ playbook_dir }}/{{ _task_file_path }}" + _test_file_exists: "{{ _full_file_path is exists }}" + when: _test_file_exists | bool {% endraw %} tags: - external @@ -697,7 +699,9 @@ outputs: - include_tasks: "{{ _task_file_path }}" vars: _task_file_path: "{{ tripleo_role_name }}/host_prep_tasks.yaml" - when: playbook_dir ~ '/' ~ _task_file_path is exists + _full_file_path: "{{ playbook_dir }}/{{ _task_file_path }}" + _test_file_exists: "{{ _full_file_path is exists }}" + when: _test_file_exists | bool tags: - overcloud - host_prep_steps @@ -767,7 +771,9 @@ outputs: - include_tasks: "{{ _task_file_path }}" vars: _task_file_path: "{{ tripleo_role_name }}/pre_deploy_step_tasks.yaml" - when: playbook_dir ~ '/' ~ _task_file_path is exists + _full_file_path: "{{ playbook_dir }}/{{ _task_file_path }}" + _test_file_exists: "{{ _full_file_path is exists }}" + when: _test_file_exists | bool tags: - overcloud - pre_deploy_steps_tasks @@ -804,7 +810,9 @@ outputs: - include_tasks: "{{ _task_file_path }}" vars: _task_file_path: "external_deploy_steps_tasks_step{{step}}.yaml" - when: playbook_dir ~ '/' ~ _task_file_path is exists + _full_file_path: "{{ playbook_dir }}/{{ _task_file_path }}" + _test_file_exists: "{{ _full_file_path is exists }}" + when: _test_file_exists | bool {% endraw %} tags: - external @@ -860,7 +868,9 @@ outputs: - include_tasks: "{{ _task_file_path }}" vars: _task_file_path: "{{ tripleo_role_name }}/deploy_steps_tasks_step{{ step }}.yaml" - when: playbook_dir ~ '/' ~ _task_file_path is exists + _full_file_path: "{{ playbook_dir }}/{{ _task_file_path }}" + _test_file_exists: "{{ _full_file_path is exists }}" + when: _test_file_exists | bool {% endraw %} - name: Overcloud common deploy step tasks {{step}} block: @@ -992,7 +1002,9 @@ outputs: - include_tasks: "{{ _task_file_path }}" vars: _task_file_path: "{{ tripleo_role_name }}/host_prep_tasks.yaml" - when: playbook_dir ~ '/' ~ _task_file_path is exists + _full_file_path: "{{ playbook_dir }}/{{ _task_file_path }}" + _test_file_exists: "{{ _full_file_path is exists }}" + when: _test_file_exists | bool {% endraw %} - import_tasks: deploy_steps_tasks_step_0.yaml vars: @@ -1078,7 +1090,9 @@ outputs: - include_tasks: "{{ _task_file_path }}" vars: _task_file_path: "{{ tripleo_role_name }}/pre_upgrade_rolling_tasks.yaml" - when: playbook_dir ~ '/' ~ _task_file_path is exists + _full_file_path: "{{ playbook_dir }}/{{ _task_file_path }}" + _test_file_exists: "{{ _full_file_path is exists }}" + when: _test_file_exists | bool tags: - always {% endraw %} @@ -1128,7 +1142,9 @@ outputs: - include_tasks: "{{ _task_file_path }}" vars: _task_file_path: "{{ tripleo_role_name }}/upgrade_tasks_step{{ step }}.yaml" - when: playbook_dir ~ '/' ~ _task_file_path is exists + _full_file_path: "{{ playbook_dir }}/{{ _task_file_path }}" + _test_file_exists: "{{ _full_file_path is exists }}" + when: _test_file_exists | bool tags: - always {% endraw %} @@ -1142,7 +1158,9 @@ outputs: - include_tasks: "{{ _task_file_path }}" vars: _task_file_path: "{{ tripleo_role_name }}/post_upgrade_tasks.yaml" - when: playbook_dir ~ '/' ~ _task_file_path is exists + _full_file_path: "{{ playbook_dir }}/{{ _task_file_path }}" + _test_file_exists: "{{ _full_file_path is exists }}" + when: _test_file_exists | bool tags: - always {% endraw %} @@ -1304,7 +1322,9 @@ outputs: - include_tasks: "{{ _task_file_path }}" vars: _task_file_path: "{{ tripleo_role_name }}/post_update_tasks.yaml" - when: playbook_dir ~ '/' ~ _task_file_path is exists + _full_file_path: "{{ playbook_dir }}/{{ _task_file_path }}" + _test_file_exists: "{{ _full_file_path is exists }}" + when: _test_file_exists | bool tags: - always {% endraw %}