Breakdown the deploy-steps playbook

This change breaks the deploy-steps monster playbook into isolated playbook
files allowing us to use the deploy-steps entrypoint as a playbook router.

With this change we'll be able to further optimise our playbook processes
in isolation and begin exploring different methods of deployment for parts
of our stack. Additionally this change will make it possible for advanced
users to run playbooks as needed, without having to run everything from
top to bottom.

Change-Id: I34bb41e63ccc65ae47999758ab7ce8a6120ef0a4
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This commit is contained in:
Kevin Carter 2021-05-25 12:03:02 -05:00
parent 90f3f42736
commit 859f313034
1 changed files with 58 additions and 15 deletions

View File

@ -441,7 +441,7 @@ outputs:
container_puppet_script: {get_file: ./container-puppet.sh}
generate-config-tasks: {get_file: generate-config-tasks.yaml}
host-container-puppet-tasks: {get_file: host-container-puppet-tasks.yaml}
deploy_steps_playbook:
deploy_steps_0_playbook:
{% block deploy_steps_str_replace_params %}
str_replace:
params:
@ -493,7 +493,9 @@ outputs:
vars:
deploy_source_host: "DEPLOY_SOURCE_HOST"
deploy_target_host: "DEPLOY_TARGET_HOST"
deploy_steps_selinux_playbook:
{{ self.deploy_steps_str_replace_params() }}
template: |
- hosts: DEPLOY_TARGET_HOST
strategy: tripleo_linear
name: Manage SELinux
@ -521,7 +523,9 @@ outputs:
tripleo_hosts_entries_extra_hosts_entries: "{{ extra_hosts_entries }}"
tripleo_hosts_entries_vip_hosts_entries: "{{ vip_hosts_entries }}"
{% endraw %}
deploy_steps_common_roles_playbook:
{{ self.deploy_steps_str_replace_params() }}
template: |
- hosts: DEPLOY_TARGET_HOST
strategy: tripleo_linear
name: Common roles for TripleO servers
@ -542,7 +546,9 @@ outputs:
name: tripleo_ssh_known_hosts
tags:
- common_roles
deploy_steps_0_tasks_playbook:
{{ self.deploy_steps_str_replace_params() }}
template: |
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
strategy: tripleo_free
name: Deploy step tasks for step 0
@ -567,7 +573,9 @@ outputs:
- overcloud
- deploy_steps
- step0
deploy_steps_pre_network_playbook:
{{ self.deploy_steps_str_replace_params() }}
template: |
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
strategy: tripleo_free
name: Server pre network steps
@ -591,7 +599,9 @@ outputs:
tags:
- overcloud
- pre_deploy_steps
deploy_steps_network_deployments_playbook:
{{ self.deploy_steps_str_replace_params() }}
template: |
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
strategy: tripleo_free
name: Server network deployments
@ -629,7 +639,9 @@ outputs:
- pre_deploy_steps
- network_deploy_steps
{% endraw %}
deploy_steps_network_validation_playbook:
{{ self.deploy_steps_str_replace_params() }}
template: |
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
strategy: tripleo_free
name: Server network validation
@ -650,7 +662,9 @@ outputs:
- pre_deploy_steps
- network_deploy_steps
{% endraw %}
deploy_steps_pre_deployment_playbook:
{{ self.deploy_steps_str_replace_params() }}
template: |
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
strategy: tripleo_free
name: Server pre deployment steps
@ -672,7 +686,9 @@ outputs:
tags:
- overcloud
- pre_deploy_steps
deploy_steps_host_prep_playbook:
{{ self.deploy_steps_str_replace_params() }}
template: |
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
strategy: tripleo_free
name: Host prep steps
@ -715,7 +731,9 @@ outputs:
tags:
- overcloud
- host_prep_steps
deploy_steps_container_setup_tasks_playbook:
{{ self.deploy_steps_str_replace_params() }}
template: |
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
strategy: tripleo_free
name: Overcloud container setup tasks
@ -748,7 +766,9 @@ outputs:
tags:
- overcloud
- container_setup_tasks
deploy_steps_pre_deployment_tasks_playbook:
{{ self.deploy_steps_str_replace_params() }}
template: |
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
strategy: tripleo_free
name: Pre Deployment Step Tasks
@ -782,9 +802,10 @@ outputs:
tags:
- overcloud
- pre_deploy_steps_tasks
deploy_steps_external_deployment_playbook:
{{ self.deploy_steps_str_replace_params() }}
template: |
{%- for step in range(1,deploy_steps_max) %}
- hosts: DEPLOY_SOURCE_HOST
strategy: tripleo_free
name: External deployment step {{step}}
@ -893,6 +914,10 @@ outputs:
- step{{step}}
{%- endfor %}
deploy_steps_post_deployment_playbook:
{{ self.deploy_steps_str_replace_params() }}
template: |
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
strategy: tripleo_free
name: Server Post Deployments
@ -914,7 +939,9 @@ outputs:
- overcloud
- post_deploy_steps
{% endraw %}
deploy_steps_post_deploy_tasks_playbook:
{{ self.deploy_steps_str_replace_params() }}
template: |
- hosts: DEPLOY_SOURCE_HOST
strategy: tripleo_linear
name: External deployment Post Deploy tasks
@ -943,7 +970,23 @@ outputs:
- external
- external_deploy_steps
- external_post_deploy_steps
deploy_steps_playbook:
{{ self.deploy_steps_str_replace_params() }}
template: |
- import_playbook: deploy_steps_0_playbook.yaml
- import_playbook: deploy_steps_selinux_playbook.yaml
- import_playbook: deploy_steps_common_roles_playbook.yaml
- import_playbook: deploy_steps_0_tasks_playbook.yaml
- import_playbook: deploy_steps_pre_network_playbook.yaml
- import_playbook: deploy_steps_network_deployments_playbook.yaml
- import_playbook: deploy_steps_network_validation_playbook.yaml
- import_playbook: deploy_steps_pre_deployment_playbook.yaml
- import_playbook: deploy_steps_host_prep_playbook.yaml
- import_playbook: deploy_steps_container_setup_tasks_playbook.yaml
- import_playbook: deploy_steps_pre_deployment_tasks_playbook.yaml
- import_playbook: deploy_steps_external_deployment_playbook.yaml
- import_playbook: deploy_steps_post_deployment_playbook.yaml
- import_playbook: deploy_steps_post_deploy_tasks_playbook.yaml
external_deploy_steps_tasks: {get_attr: [ExternalDeployTasks, value]}
external_post_deploy_steps_tasks: {get_attr: [ExternalPostDeployTasks, value]}
pre_deploy_step_tasks: {get_attr: [PreDeployStepTasks, value]}