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/10.6.1
James Slagle 3 weeks ago
parent
commit
9858e6eb49
1 changed files with 4 additions and 5 deletions
  1. 4
    5
      common/deploy-steps.j2

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

@@ -348,9 +348,10 @@ outputs:
348 348
               tags:
349 349
                 - overcloud
350 350
                 - pre_deploy_steps
351
+{%- for role in roles %}
351 352
 
352
-            - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
353
-              name: Host prep steps
353
+            - hosts: {{role.name}}
354
+              name: {{role.name}} Host prep steps
354 355
               gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
355 356
               any_errors_fatal: yes
356 357
               vars:
@@ -365,13 +366,11 @@ outputs:
365 366
                 docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
366 367
                 docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
367 368
               tasks:
368
-{%- for role in roles %}
369 369
                 - import_tasks: {{role.name}}/host_prep_tasks.yaml
370
-                  when: tripleo_role_name == '{{role.name}}'
371
-{%- endfor %}
372 370
               tags:
373 371
                 - overcloud
374 372
                 - host_prep_steps
373
+{%- endfor %}
375 374
 
376 375
 {%- for step in range(1,deploy_steps_max) %}
377 376
 

Loading…
Cancel
Save