Browse Source

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)
tags/8.4.1
James Slagle 3 weeks ago
parent
commit
581391ac46
1 changed files with 5 additions and 6 deletions
  1. 5
    6
      common/deploy-steps.j2

+ 5
- 6
common/deploy-steps.j2 View File

@@ -437,9 +437,10 @@ outputs:
437 437
               tags:
438 438
                 - overcloud
439 439
                 - pre_deploy_steps
440
+{%- for role in roles %}
440 441
 
441
-            - hosts: {{primary_role_name}}:overcloud
442
-              name: Host prep steps
442
+            - hosts: {{role.name}}
443
+              name: {{role.name}} Host prep steps
443 444
               gather_facts: no
444 445
               any_errors_fatal: yes
445 446
               vars:
@@ -450,13 +451,11 @@ outputs:
450 451
                   file: path=/var/lib/docker-puppet state=directory setype=svirt_sandbox_file_t selevel=s0 recurse=true
451 452
                 - name: Write docker-puppet.py
452 453
                   copy: src=docker_puppet_script.yaml dest=/var/lib/docker-puppet/docker-puppet.py force=yes mode=0600
453
-{%- for role in roles %}
454
-                - include: {{role.name}}/host_prep_tasks.yaml
455
-                  when: tripleo_role_name == '{{role.name}}'
456
-{%- endfor %}
454
+                - import_tasks: {{role.name}}/host_prep_tasks.yaml
457 455
               tags:
458 456
                 - overcloud
459 457
                 - host_prep_steps
458
+{%- endfor %}
460 459
 
461 460
 {%- for step in range(1,deploy_steps_max) %}
462 461
 

Loading…
Cancel
Save