Use separate plays for Host prep steps

Instead of using one task include per role in the same play, use
separate plays instead. This reduces the amount of task skipping that
Ansible has to do since each include only applies to a single role.

In a deployment with many roles, this will improve performance.

Change-Id: I01ef631ea3dad8b9c030d61ed0883a9af13616ad
(cherry picked from commit 493d1c62fd)
This commit is contained in:
James Slagle 2019-08-28 17:57:05 -04:00
parent d32ac76546
commit 581391ac46
1 changed files with 5 additions and 6 deletions

View File

@ -437,9 +437,10 @@ outputs:
tags: tags:
- overcloud - overcloud
- pre_deploy_steps - pre_deploy_steps
{%- for role in roles %}
- hosts: {{primary_role_name}}:overcloud - hosts: {{role.name}}
name: Host prep steps name: {{role.name}} Host prep steps
gather_facts: no gather_facts: no
any_errors_fatal: yes any_errors_fatal: yes
vars: vars:
@ -450,13 +451,11 @@ outputs:
file: path=/var/lib/docker-puppet state=directory setype=svirt_sandbox_file_t selevel=s0 recurse=true file: path=/var/lib/docker-puppet state=directory setype=svirt_sandbox_file_t selevel=s0 recurse=true
- name: Write docker-puppet.py - name: Write docker-puppet.py
copy: src=docker_puppet_script.yaml dest=/var/lib/docker-puppet/docker-puppet.py force=yes mode=0600 copy: src=docker_puppet_script.yaml dest=/var/lib/docker-puppet/docker-puppet.py force=yes mode=0600
{%- for role in roles %} - import_tasks: {{role.name}}/host_prep_tasks.yaml
- include: {{role.name}}/host_prep_tasks.yaml
when: tripleo_role_name == '{{role.name}}'
{%- endfor %}
tags: tags:
- overcloud - overcloud
- host_prep_steps - host_prep_steps
{%- endfor %}
{%- for step in range(1,deploy_steps_max) %} {%- for step in range(1,deploy_steps_max) %}