Merge "Use exists filter instead of stat where possible"

This commit is contained in:
Zuul 2020-03-16 15:02:25 +00:00 committed by Gerrit Code Review
commit 67bdcba7ab
2 changed files with 8 additions and 18 deletions

View File

@ -26,15 +26,10 @@
copy: src=container_puppet_script.yaml dest=/var/lib/container-puppet/container-puppet.sh force=yes mode=0755 setype=container_file_t
{%- for role in roles %}
- name: Check for {{role.name}}/deploy_steps_tasks_step0.yaml
delegate_to: localhost
run_once: true
become: false
stat:
path: "{{ '{{' }} playbook_dir ~ '/' ~ '{{role.name}}' ~ '/' ~ 'deploy_steps_tasks_step0.yaml' {{ '}}' }}"
register: tasks_stat
- include_tasks: {{role.name}}/deploy_steps_tasks_step0.yaml
- include_tasks: "{% raw %}{{ _task_file_path }}{% endraw %}"
vars:
_task_file_path: "{{role.name}}/deploy_steps_tasks_step0.yaml"
when:
- tripleo_role_name == '{{role.name}}'
- tasks_stat.stat.exists
- "{% raw %}'{{ playbook_dir }}/{{ _task_file_path }}' is exists{% endraw %}"
{%- endfor %}

View File

@ -709,17 +709,12 @@ outputs:
debug:
msg: Use --start-at-task 'Deploy step tasks for {{step}}' to resume from this task
{%- for role in roles %}
- name: Check for {{role.name}}/deploy_steps_tasks_step{{step}}.yaml
delegate_to: localhost
become: false
run_once: true
stat:
path: "{{ '{{' }} playbook_dir ~ '/' ~ '{{role.name}}' ~ '/' ~ 'deploy_steps_tasks_step{{step}}.yaml' {{ '}}' }}"
register: tasks_stat
- include_tasks: {{role.name}}/deploy_steps_tasks_step{{step}}.yaml
- include_tasks: "{% raw %}{{ _task_file_path }}{% endraw %}"
vars:
_task_file_path: "{{role.name}}/deploy_steps_tasks_step{{step}}.yaml"
when:
- tripleo_role_name == '{{role.name}}'
- tasks_stat.stat.exists
- "{% raw %}'{{ playbook_dir }}/{{ _task_file_path }}' is exists{% endraw %}"
{%- endfor %}
tags:
- overcloud