Split quickstart-extras.yml into sub-playbooks
This should allow easier composition of custom playbooks from bits and pieces of quickstart-extras.yml. It will be especially useful when one wants to reuse existing environment (e.g. deployed undercloud) and perform additional automated actions on it. (The current solution has been to use ansible tags, which has been quite error prone for me, and i've sometimes ended up ruining my dev environment. Composing custom playbooks is both safer and more straightforward to reason about.) Depends-On: I513149a9de524dd3f017c583d06c35a165581715 Change-Id: Ie40da10fb96265340b243fff9b48fd18640de978
This commit is contained in:
parent
09803a3625
commit
30ce59c49e
40
playbooks/quickstart-extras-overcloud-prep.yml
Normal file
40
playbooks/quickstart-extras-overcloud-prep.yml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
# Prepare any additional configuration files required by the overcloud
|
||||||
|
- name: Prepare configuration files for the overcloud deployment
|
||||||
|
hosts: undercloud
|
||||||
|
gather_facts: no
|
||||||
|
roles:
|
||||||
|
- overcloud-prep-config
|
||||||
|
|
||||||
|
# Prepare the overcloud for a containerized deployment
|
||||||
|
- name: Prepare overcloud containers
|
||||||
|
hosts: undercloud
|
||||||
|
gather_facts: no
|
||||||
|
roles:
|
||||||
|
- overcloud-prep-containers
|
||||||
|
|
||||||
|
# Prepare the overcloud images for deployment
|
||||||
|
- name: Prepare the overcloud images for deployment
|
||||||
|
hosts: undercloud
|
||||||
|
gather_facts: no
|
||||||
|
roles:
|
||||||
|
- overcloud-prep-images
|
||||||
|
|
||||||
|
# Prepare the overcloud flavor configuration
|
||||||
|
- name: Prepare overcloud flavors
|
||||||
|
hosts: undercloud
|
||||||
|
gather_facts: no
|
||||||
|
roles:
|
||||||
|
- overcloud-prep-flavors
|
||||||
|
|
||||||
|
# Prepare the undercloud networks for the overcloud deployment
|
||||||
|
- name: Prepare the undercloud networks for the overcloud deployment
|
||||||
|
hosts: undercloud
|
||||||
|
gather_facts: no
|
||||||
|
roles:
|
||||||
|
- overcloud-prep-network
|
||||||
|
|
||||||
|
- name: Prepare the SSL Configuration for the overcloud deployment
|
||||||
|
hosts: undercloud
|
||||||
|
gather_facts: no
|
||||||
|
roles:
|
||||||
|
- { role: overcloud-ssl, when: ssl_overcloud|bool }
|
33
playbooks/quickstart-extras-overcloud.yml
Normal file
33
playbooks/quickstart-extras-overcloud.yml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# Deploy the overcloud
|
||||||
|
- name: Deploy the overcloud
|
||||||
|
hosts: undercloud
|
||||||
|
gather_facts: yes
|
||||||
|
tags:
|
||||||
|
- overcloud-deploy
|
||||||
|
roles:
|
||||||
|
- overcloud-deploy
|
||||||
|
|
||||||
|
- name: Add the overcloud nodes to the generated inventory
|
||||||
|
hosts: undercloud
|
||||||
|
gather_facts: yes
|
||||||
|
tags:
|
||||||
|
- overcloud-deploy
|
||||||
|
vars:
|
||||||
|
inventory: all
|
||||||
|
roles:
|
||||||
|
- tripleo-inventory
|
||||||
|
|
||||||
|
# Check the results of the deployment, note after inventory has executed
|
||||||
|
- name: Check the result of the deployment
|
||||||
|
hosts: localhost
|
||||||
|
tags:
|
||||||
|
- overcloud-deploy
|
||||||
|
tasks:
|
||||||
|
- name: ensure the deployment result has been read into memory
|
||||||
|
include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json"
|
||||||
|
|
||||||
|
# overcloud_deploy_result = ["failed", "passed"]
|
||||||
|
- name: did the deployment pass or fail?
|
||||||
|
debug:
|
||||||
|
var: overcloud_deploy_result
|
||||||
|
failed_when: overcloud_deploy_result == "failed"
|
22
playbooks/quickstart-extras-undercloud.yml
Normal file
22
playbooks/quickstart-extras-undercloud.yml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# Deploy the FreeIPA server
|
||||||
|
- name: Deploy the FreeIPA server
|
||||||
|
hosts: supplemental
|
||||||
|
gather_facts: no
|
||||||
|
roles:
|
||||||
|
- { role: freeipa-setup, when: deploy_supplemental_node|bool and enable_tls_everywhere|bool }
|
||||||
|
|
||||||
|
# setup for the undercloud
|
||||||
|
- name: Setup the undercloud
|
||||||
|
hosts: undercloud
|
||||||
|
gather_facts: no
|
||||||
|
vars:
|
||||||
|
ansible_user: root
|
||||||
|
roles:
|
||||||
|
- { role: undercloud-setup, when: undercloud_setup|bool }
|
||||||
|
|
||||||
|
# Deploy the undercloud
|
||||||
|
- name: Deploy the undercloud
|
||||||
|
hosts: undercloud
|
||||||
|
gather_facts: no
|
||||||
|
roles:
|
||||||
|
- undercloud-deploy
|
17
playbooks/quickstart-extras-validate.yml
Normal file
17
playbooks/quickstart-extras-validate.yml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Validate the deployment
|
||||||
|
- name: validate the overcloud
|
||||||
|
hosts: undercloud
|
||||||
|
tags:
|
||||||
|
- overcloud-validate
|
||||||
|
gather_facts: no
|
||||||
|
roles:
|
||||||
|
- { role: validate-simple, when: test_ping|bool }
|
||||||
|
|
||||||
|
# Execute tempest against the overcloud deployment
|
||||||
|
- name: Execute tempest against the overcloud
|
||||||
|
hosts: undercloud
|
||||||
|
tags:
|
||||||
|
- overcloud-validate
|
||||||
|
gather_facts: no
|
||||||
|
roles:
|
||||||
|
- { role: validate-tempest, when: run_tempest|bool }
|
@ -1,120 +1,7 @@
|
|||||||
# This is the playbook used by the `quickstart.sh` script.
|
# This is the playbook used by the `quickstart.sh` script.
|
||||||
|
|
||||||
- include: quickstart.yml
|
- include: quickstart.yml
|
||||||
|
- include: quickstart-extras-undercloud.yml
|
||||||
# Deploy the FreeIPA server
|
- include: quickstart-extras-overcloud-prep.yml
|
||||||
- name: Deploy the FreeIPA server
|
- include: quickstart-extras-overcloud.yml
|
||||||
hosts: supplemental
|
- include: quickstart-extras-validate.yml
|
||||||
gather_facts: no
|
|
||||||
roles:
|
|
||||||
- { role: freeipa-setup, when: deploy_supplemental_node|bool and enable_tls_everywhere|bool }
|
|
||||||
|
|
||||||
# setup for the undercloud
|
|
||||||
- name: Setup the undercloud
|
|
||||||
hosts: undercloud
|
|
||||||
gather_facts: no
|
|
||||||
vars:
|
|
||||||
ansible_user: root
|
|
||||||
roles:
|
|
||||||
- { role: undercloud-setup, when: undercloud_setup|bool }
|
|
||||||
|
|
||||||
# Deploy the undercloud
|
|
||||||
- name: Deploy the undercloud
|
|
||||||
hosts: undercloud
|
|
||||||
gather_facts: no
|
|
||||||
roles:
|
|
||||||
- undercloud-deploy
|
|
||||||
|
|
||||||
# Prepare any additional configuration files required by the overcloud
|
|
||||||
- name: Prepare configuration files for the overcloud deployment
|
|
||||||
hosts: undercloud
|
|
||||||
gather_facts: no
|
|
||||||
roles:
|
|
||||||
- overcloud-prep-config
|
|
||||||
|
|
||||||
# Prepare the overcloud for a containerized deployment
|
|
||||||
- name: Prepare overcloud containers
|
|
||||||
hosts: undercloud
|
|
||||||
gather_facts: no
|
|
||||||
roles:
|
|
||||||
- overcloud-prep-containers
|
|
||||||
|
|
||||||
# Prepare the overcloud images for deployment
|
|
||||||
- name: Prepare the overcloud images for deployment
|
|
||||||
hosts: undercloud
|
|
||||||
gather_facts: no
|
|
||||||
roles:
|
|
||||||
- overcloud-prep-images
|
|
||||||
|
|
||||||
# Prepare the overcloud flavor configuration
|
|
||||||
- name: Prepare overcloud flavors
|
|
||||||
hosts: undercloud
|
|
||||||
gather_facts: no
|
|
||||||
roles:
|
|
||||||
- overcloud-prep-flavors
|
|
||||||
|
|
||||||
# Prepare the undercloud networks for the overcloud deployment
|
|
||||||
- name: Prepare the undercloud networks for the overcloud deployment
|
|
||||||
hosts: undercloud
|
|
||||||
gather_facts: no
|
|
||||||
roles:
|
|
||||||
- overcloud-prep-network
|
|
||||||
|
|
||||||
- name: Prepare the SSL Configuration for the overcloud deployment
|
|
||||||
hosts: undercloud
|
|
||||||
gather_facts: no
|
|
||||||
roles:
|
|
||||||
- { role: overcloud-ssl, when: ssl_overcloud|bool }
|
|
||||||
|
|
||||||
# Deploy the overcloud
|
|
||||||
- name: Deploy the overcloud
|
|
||||||
hosts: undercloud
|
|
||||||
gather_facts: yes
|
|
||||||
tags:
|
|
||||||
- overcloud-deploy
|
|
||||||
roles:
|
|
||||||
- overcloud-deploy
|
|
||||||
|
|
||||||
- name: Add the overcloud nodes to the generated inventory
|
|
||||||
hosts: undercloud
|
|
||||||
gather_facts: yes
|
|
||||||
tags:
|
|
||||||
- overcloud-deploy
|
|
||||||
vars:
|
|
||||||
inventory: all
|
|
||||||
roles:
|
|
||||||
- tripleo-inventory
|
|
||||||
|
|
||||||
# Check the results of the deployment, note after inventory has executed
|
|
||||||
- name: Check the result of the deployment
|
|
||||||
hosts: localhost
|
|
||||||
tags:
|
|
||||||
- overcloud-deploy
|
|
||||||
tasks:
|
|
||||||
- name: ensure the deployment result has been read into memory
|
|
||||||
include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json"
|
|
||||||
|
|
||||||
# overcloud_deploy_result = ["failed", "passed"]
|
|
||||||
- name: did the deployment pass or fail?
|
|
||||||
debug:
|
|
||||||
var: overcloud_deploy_result
|
|
||||||
failed_when: overcloud_deploy_result == "failed"
|
|
||||||
|
|
||||||
# Validate the deployment
|
|
||||||
- name: validate the overcloud
|
|
||||||
hosts: undercloud
|
|
||||||
tags:
|
|
||||||
- overcloud-validate
|
|
||||||
gather_facts: no
|
|
||||||
roles:
|
|
||||||
- { role: validate-simple, when: test_ping|bool }
|
|
||||||
|
|
||||||
# Execute tempest against the overcloud deployment
|
|
||||||
- name: Execute tempest against the overcloud
|
|
||||||
hosts: undercloud
|
|
||||||
tags:
|
|
||||||
- overcloud-validate
|
|
||||||
gather_facts: no
|
|
||||||
roles:
|
|
||||||
- { role: validate-tempest, when: run_tempest|bool }
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user