Execute deploy_steps_tasks per step

Instead of including the entire deploy_steps_tasks.yaml tasks file for
each role at each step, use the per-step files and only if they exist.

This cuts down on the amount of time that ansible has to spend skipping
tasks that don't get run at a certain step, which can be significant at
scale.

Change-Id: I06ee04b9b47226433f25e3cff08c461462a907d9
Depends-On: Id5fdb4dd1a6290d1097d2d81523161c87ab6d4dd
This commit is contained in:
James Slagle 2019-12-11 21:39:44 -05:00
parent af88862d9b
commit 2a6336a742
2 changed files with 24 additions and 4 deletions

View File

@ -1,4 +1,6 @@
- name: Deploy step tasks for step 0
delegate_to: localhost
run_once: true
debug:
msg: Use --start-at-task 'Deploy step tasks for step 0' to resume from this task
when: "tripleo_minor_update is not defined or tripleo_minor_update != 'true'"
@ -13,6 +15,15 @@
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 %}
- include_tasks: {{role.name}}/deploy_steps_tasks.yaml
when: tripleo_role_name == '{{role.name}}'
- 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
when:
- tripleo_role_name == '{{role.name}}'
- tasks_stat.stat.exists
{%- endfor %}

View File

@ -782,8 +782,17 @@ outputs:
debug:
msg: Use --start-at-task 'Deploy step tasks for {{step}}' to resume from this task
{%- for role in roles %}
- include_tasks: {{role.name}}/deploy_steps_tasks.yaml
when: tripleo_role_name == '{{role.name}}'
- 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
when:
- tripleo_role_name == '{{role.name}}'
- tasks_stat.stat.exists
{%- endfor %}
tags:
- overcloud