Eliminate unnecessary role looping in deploy-steps.j2
These role task inclusions force a linear-like sequence
and result in a lot of unnecessary skipped tasks. This
takes extra time, and causes a lot of log noise which
makes debugging more difficult.
Given that a host can ever only have a single role, it
makes more sense to just include the applicable role
task file if it exists.
Change-Id: Id2cadceaaf563dc94fcf2d8ce0f0cb9054a65d40
(cherry picked from commit c8fba9b237
)
This commit is contained in:
parent
a9122e3ee4
commit
5d257de37a
|
@ -55,7 +55,6 @@ ChangeLog
|
||||||
|
|
||||||
# Leftovers from other commants like tox -e pep8,tht
|
# Leftovers from other commants like tox -e pep8,tht
|
||||||
.cache
|
.cache
|
||||||
common/deploy-steps-tasks-step-0.yaml
|
|
||||||
common/post.yaml
|
common/post.yaml
|
||||||
common/services/blockstorage-role.yaml
|
common/services/blockstorage-role.yaml
|
||||||
common/services/cephstorage-role.yaml
|
common/services/cephstorage-role.yaml
|
||||||
|
|
|
@ -38,12 +38,7 @@
|
||||||
become: true
|
become: true
|
||||||
no_log: True
|
no_log: True
|
||||||
copy: src=container_puppet_script.yaml dest=/var/lib/container-puppet/container-puppet.sh force=yes mode=0755 setype=container_file_t
|
copy: src=container_puppet_script.yaml dest=/var/lib/container-puppet/container-puppet.sh force=yes mode=0755 setype=container_file_t
|
||||||
|
- include_tasks: "{{ _task_file_path }}"
|
||||||
{%- for role in roles %}
|
|
||||||
- include_tasks: "{% raw %}{{ _task_file_path }}{% endraw %}"
|
|
||||||
vars:
|
vars:
|
||||||
_task_file_path: "{{role.name}}/deploy_steps_tasks_step0.yaml"
|
_task_file_path: "{{ tripleo_role_name }}/deploy_steps_tasks_step0.yaml"
|
||||||
when:
|
when: "'{{ playbook_dir }}/{{ _task_file_path }}' is exists"
|
||||||
- tripleo_role_name == '{{role.name}}'
|
|
||||||
- "{% raw %}'{{ playbook_dir }}/{{ _task_file_path }}' is exists{% endraw %}"
|
|
||||||
{%- endfor %}
|
|
|
@ -691,12 +691,12 @@ outputs:
|
||||||
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
|
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
|
||||||
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
|
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
|
||||||
tasks:
|
tasks:
|
||||||
|
{% raw %}
|
||||||
- name: Host prep steps
|
- name: Host prep steps
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
run_once: true
|
run_once: true
|
||||||
debug:
|
debug:
|
||||||
msg: Use --start-at-task 'Host prep steps' to resume from this task
|
msg: Use --start-at-task 'Host prep steps' to resume from this task
|
||||||
{% raw %}
|
|
||||||
- name: Deploy Artifacts
|
- name: Deploy Artifacts
|
||||||
tripleo_push_artifacts:
|
tripleo_push_artifacts:
|
||||||
artifact_urls: "{{ deploy_artifact_urls | default([]) }}"
|
artifact_urls: "{{ deploy_artifact_urls | default([]) }}"
|
||||||
|
@ -704,16 +704,14 @@ outputs:
|
||||||
when:
|
when:
|
||||||
- ((deploy_artifact_urls | default([]) | length) > 0) or
|
- ((deploy_artifact_urls | default([]) | length) > 0) or
|
||||||
((deploy_artifact_files | default([]) | length) > 0)
|
((deploy_artifact_files | default([]) | length) > 0)
|
||||||
{% endraw %}
|
- include_tasks: "{{ _task_file_path }}"
|
||||||
{%- for role in roles %}
|
vars:
|
||||||
- name: {{role.name}} Host prep tasks
|
_task_file_path: "{{ tripleo_role_name }}/host_prep_tasks.yaml"
|
||||||
include_tasks: {{role.name}}/host_prep_tasks.yaml
|
when: "'{{ playbook_dir }}/{{ _task_file_path }}' is exists"
|
||||||
when:
|
|
||||||
- tripleo_role_name == '{{role.name}}'
|
|
||||||
{%- endfor %}
|
|
||||||
tags:
|
tags:
|
||||||
- overcloud
|
- overcloud
|
||||||
- host_prep_steps
|
- host_prep_steps
|
||||||
|
{% endraw %}
|
||||||
deploy_steps_container_setup_tasks_playbook:
|
deploy_steps_container_setup_tasks_playbook:
|
||||||
{{ self.deploy_steps_str_replace_params() }}
|
{{ self.deploy_steps_str_replace_params() }}
|
||||||
template: |
|
template: |
|
||||||
|
@ -770,21 +768,20 @@ outputs:
|
||||||
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
|
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
|
||||||
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
|
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
|
||||||
tasks:
|
tasks:
|
||||||
|
{% raw %}
|
||||||
- name: Pre Deployment Step Tasks
|
- name: Pre Deployment Step Tasks
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
run_once: true
|
run_once: true
|
||||||
debug:
|
debug:
|
||||||
msg: Use --start-at-task 'Pre Deployment Step Tasks' to resume from this task
|
msg: Use --start-at-task 'Pre Deployment Step Tasks' to resume from this task
|
||||||
{%- for role in roles %}
|
- include_tasks: "{{ _task_file_path }}"
|
||||||
- name: {{role.name}} Pre Deployment Step Tasks block
|
vars:
|
||||||
include_tasks: {{role.name}}/pre_deploy_step_tasks.yaml
|
_task_file_path: "{{ tripleo_role_name }}/pre_deploy_step_tasks.yaml"
|
||||||
when:
|
when: "'{{ playbook_dir }}/{{ _task_file_path }}' is exists"
|
||||||
- tripleo_role_name == '{{role.name}}'
|
|
||||||
- playbook_dir ~ '/{{role.name}}/pre_deploy_step_tasks.yaml' is exists
|
|
||||||
{%- endfor %}
|
|
||||||
tags:
|
tags:
|
||||||
- overcloud
|
- overcloud
|
||||||
- pre_deploy_steps_tasks
|
- pre_deploy_steps_tasks
|
||||||
|
{% endraw %}
|
||||||
deploy_steps_external_deployment_playbook:
|
deploy_steps_external_deployment_playbook:
|
||||||
{{ self.deploy_steps_str_replace_params() }}
|
{{ self.deploy_steps_str_replace_params() }}
|
||||||
template: |
|
template: |
|
||||||
|
@ -866,12 +863,12 @@ outputs:
|
||||||
- ((deploy_identifier is defined and deploy_identifier != "" and deploy_identifier is not none) or
|
- ((deploy_identifier is defined and deploy_identifier != "" and deploy_identifier is not none) or
|
||||||
not container_startup_configs_json_stat.stat.exists)
|
not container_startup_configs_json_stat.stat.exists)
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{%- for role in roles %}
|
{% raw %}
|
||||||
- include_tasks: "{{role.name}}/deploy_steps_tasks_step{{step}}.yaml"
|
- include_tasks: "{{ _task_file_path }}"
|
||||||
when:
|
vars:
|
||||||
- tripleo_role_name == '{{role.name}}'
|
_task_file_path: "{{ tripleo_role_name }}/deploy_steps_tasks_step{{ step }}.yaml"
|
||||||
- playbook_dir ~ '/{{role.name}}/deploy_steps_tasks_step{{step}}.yaml' is exists
|
when: "'{{ playbook_dir }}/{{ _task_file_path }}' is exists"
|
||||||
{%- endfor %}
|
{% endraw %}
|
||||||
- name: Overcloud common deploy step tasks {{step}}
|
- name: Overcloud common deploy step tasks {{step}}
|
||||||
block:
|
block:
|
||||||
- name: "Check if /var/lib/tripleo-config/container-startup-config/step_{{step}} already exists"
|
- name: "Check if /var/lib/tripleo-config/container-startup-config/step_{{step}} already exists"
|
||||||
|
@ -998,8 +995,12 @@ outputs:
|
||||||
vars:
|
vars:
|
||||||
step: "{{ step }}"
|
step: "{{ step }}"
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
- import_tasks: "{{role.name}}/host_prep_tasks.yaml"
|
{% raw %}
|
||||||
when: tripleo_role_name == '{{role.name}}'
|
- include_tasks: "{{ _task_file_path }}"
|
||||||
|
vars:
|
||||||
|
_task_file_path: "{{ tripleo_role_name }}/host_prep_tasks.yaml"
|
||||||
|
when: "'{{ playbook_dir }}/{{ _task_file_path }}' is exists"
|
||||||
|
{% endraw %}
|
||||||
- import_tasks: deploy_steps_tasks_step_0.yaml
|
- import_tasks: deploy_steps_tasks_step_0.yaml
|
||||||
vars:
|
vars:
|
||||||
step: 0
|
step: 0
|
||||||
|
@ -1080,12 +1081,14 @@ outputs:
|
||||||
- step{{step}}
|
- step{{step}}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
pre_upgrade_rolling_steps_tasks: |
|
pre_upgrade_rolling_steps_tasks: |
|
||||||
{%- for role in roles %}
|
{% raw %}
|
||||||
- include_tasks: {{role.name}}/pre_upgrade_rolling_tasks.yaml
|
- include_tasks: "{{ _task_file_path }}"
|
||||||
when: tripleo_role_name == '{{role.name}}'
|
vars:
|
||||||
|
_task_file_path: "{{ tripleo_role_name }}/pre_upgrade_rolling_tasks.yaml"
|
||||||
|
when: "'{{ playbook_dir }}/{{ _task_file_path }}' is exists"
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
{%- endfor %}
|
{% endraw %}
|
||||||
pre_upgrade_rolling_steps_playbook:
|
pre_upgrade_rolling_steps_playbook:
|
||||||
{{ self.deploy_steps_str_replace_params() }}
|
{{ self.deploy_steps_str_replace_params() }}
|
||||||
template: |
|
template: |
|
||||||
|
@ -1128,24 +1131,28 @@ outputs:
|
||||||
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
|
container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
|
||||||
container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
|
container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
|
||||||
tasks:
|
tasks:
|
||||||
{%- for role in roles %}
|
{% raw %}
|
||||||
- include_tasks: {{role.name}}/upgrade_tasks_step{{step}}.yaml
|
- include_tasks: "{{ _task_file_path }}"
|
||||||
when: tripleo_role_name == '{{role.name}}'
|
vars:
|
||||||
|
_task_file_path: "{{ tripleo_role_name }}/upgrade_tasks_step{{ step }}.yaml"
|
||||||
|
when: "'{{ playbook_dir }}/{{ _task_file_path }}' is exists"
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
{%- endfor %}
|
{% endraw %}
|
||||||
tags:
|
tags:
|
||||||
- upgrade_steps
|
- upgrade_steps
|
||||||
- upgrade_step{{step}}
|
- upgrade_step{{step}}
|
||||||
|
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
post_upgrade_steps_tasks: |
|
post_upgrade_steps_tasks: |
|
||||||
{%- for role in roles %}
|
{% raw %}
|
||||||
- include_tasks: {{role.name}}/post_upgrade_tasks.yaml
|
- include_tasks: "{{ _task_file_path }}"
|
||||||
when: tripleo_role_name == '{{role.name}}'
|
vars:
|
||||||
|
_task_file_path: "{{ tripleo_role_name }}/post_upgrade_tasks.yaml"
|
||||||
|
when: "'{{ playbook_dir }}/{{ _task_file_path }}' is exists"
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
{%- endfor %}
|
{% endraw %}
|
||||||
post_upgrade_steps_playbook:
|
post_upgrade_steps_playbook:
|
||||||
{{ self.deploy_steps_str_replace_params() }}
|
{{ self.deploy_steps_str_replace_params() }}
|
||||||
template: |
|
template: |
|
||||||
|
@ -1300,9 +1307,11 @@ outputs:
|
||||||
tags:
|
tags:
|
||||||
- scale
|
- scale
|
||||||
post_update_steps_tasks: |
|
post_update_steps_tasks: |
|
||||||
{%- for role in roles %}
|
{% raw %}
|
||||||
- include_tasks: {{role.name}}/post_update_tasks.yaml
|
- include_tasks: "{{ _task_file_path }}"
|
||||||
when: tripleo_role_name == '{{role.name}}'
|
vars:
|
||||||
|
_task_file_path: "{{ tripleo_role_name }}/post_update_tasks.yaml"
|
||||||
|
when: "'{{ playbook_dir }}/{{ _task_file_path }}' is exists"
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
{%- endfor %}
|
{% endraw %}
|
||||||
|
|
Loading…
Reference in New Issue