Get rid of jinja2 templating in conditional statements

... to avoid the following warning.

[WARNING]: conditional statements should not include jinja2 templating
delimiters such as {{ }} or {% %}. Found: '{{ playbook_dir }}/{{
_task_file_path }}' is exists

Change-Id: Ie804bf9bebf32f45aebc1fb63def3f2f95774e98
changes/29/865929/2
Takashi Kajinami 2022-11-29 11:19:12 +09:00
parent dfbcf7aa83
commit 29b8b6847a
2 changed files with 21 additions and 15 deletions

View File

@ -41,4 +41,4 @@
- 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"
when: playbook_dir ~ '/' ~ _task_file_path is exists

View File

@ -461,9 +461,12 @@ outputs:
run_once: true
debug:
msg: Use --start-at-task 'External deployment step 0' to resume from this task
- include_tasks: "external_deploy_steps_tasks_step0.yaml"
when:
- playbook_dir ~ '/external_deploy_steps_tasks_step0.yaml' is exists
{% raw %}
- include_tasks: "{{ _task_file_path }}"
vars:
_task_file_path: "external_deploy_steps_tasks_step0.yaml"
when: playbook_dir ~ '/' ~ _task_file_path is exists
{% endraw %}
tags:
- external
- external_deploy_steps
@ -694,7 +697,7 @@ 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"
when: playbook_dir ~ '/' ~ _task_file_path is exists
tags:
- overcloud
- host_prep_steps
@ -764,7 +767,7 @@ 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"
when: playbook_dir ~ '/' ~ _task_file_path is exists
tags:
- overcloud
- pre_deploy_steps_tasks
@ -797,9 +800,12 @@ outputs:
run_once: true
debug:
msg: Use --start-at-task 'External deployment step {{step}}' to resume from this task
- include_tasks: "external_deploy_steps_tasks_step{{step}}.yaml"
when:
- playbook_dir ~ '/external_deploy_steps_tasks_step{{step}}.yaml' is exists
{% raw %}
- include_tasks: "{{ _task_file_path }}"
vars:
_task_file_path: "external_deploy_steps_tasks_step{{step}}.yaml"
when: playbook_dir ~ '/' ~ _task_file_path is exists
{% endraw %}
tags:
- external
- external_deploy_steps
@ -854,7 +860,7 @@ 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"
when: playbook_dir ~ '/' ~ _task_file_path is exists
{% endraw %}
- name: Overcloud common deploy step tasks {{step}}
block:
@ -986,7 +992,7 @@ 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"
when: playbook_dir ~ '/' ~ _task_file_path is exists
{% endraw %}
- import_tasks: deploy_steps_tasks_step_0.yaml
vars:
@ -1072,7 +1078,7 @@ 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"
when: playbook_dir ~ '/' ~ _task_file_path is exists
tags:
- always
{% endraw %}
@ -1122,7 +1128,7 @@ 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"
when: playbook_dir ~ '/' ~ _task_file_path is exists
tags:
- always
{% endraw %}
@ -1136,7 +1142,7 @@ 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"
when: playbook_dir ~ '/' ~ _task_file_path is exists
tags:
- always
{% endraw %}
@ -1298,7 +1304,7 @@ 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"
when: playbook_dir ~ '/' ~ _task_file_path is exists
tags:
- always
{% endraw %}