Split deployment and teardown playbooks

Create deploy.yml and teardown.yml which mostly run the same playbooks in
opposite orders. Also document the new structure.
This commit is contained in:
Will Miller 2018-09-12 14:00:27 +00:00
parent c14b62f672
commit 71aa379b5b
4 changed files with 47 additions and 10 deletions

View File

@ -54,14 +54,20 @@ are:
### Running Tenks
Currently, Tenks does not have a CLI or wrapper. It can be run by calling
`ansible-playbook --inventory ansible/inventory ansible/run.yml --extra-vars=@override.yml`,
where `override.yml` is the path to your override file. The `run.yml` playbook
includes various constituent playbooks which perform different parts of the
deployment. An individual section of Tenks can be run separately by
substituting `ansible/run.yml` in the command above with the path to the
playbook you want to run. The current playbooks can be seen in the Ansible
structure diagram in the *Development* section.
Currently, Tenks does not have a CLI or wrapper. Deployment can be run by
calling `ansible-playbook --inventory ansible/inventory ansible/deploy.yml
--extra-vars=@override.yml`, where `override.yml` is the path to your override
file.
The `deploy.yml` playbook will run deployment from start to finish;
`teardown.yml` is `deploy.yml`'s "mirror image" to tear down a cluster. These
playbooks automatically set `cmd` appropriately, and they contain various
constituent playbooks which perform different parts of the deployment. An
individual section of Tenks can be run separately by substituting
`ansible/deploy.yml` in the command above with the path to the playbook(s) you
want to run. The current playbooks can be seen in the Ansible structure diagram
in the *Development* section. Bear in mind that you will have to set `cmd` in
your override file if you are running any of the sub-playbooks individually.
## Development

View File

@ -1,10 +1,15 @@
---
- name: Perform deployment host configuration
import_playbook: host_setup.yml
- hosts: all
tasks:
- set_fact:
cmd: deploy
- name: Schedule nodes
import_playbook: schedule.yml
- name: Perform deployment host configuration
import_playbook: host_setup.yml
- name: Configure node networking
import_playbook: node_networking.yml

26
ansible/teardown.yml Normal file
View File

@ -0,0 +1,26 @@
---
- hosts: all
tasks:
- set_fact:
cmd: teardown
- name: Schedule removal of nodes
import_playbook: schedule.yml
- name: Deregister flavors in Nova
import_playbook: flavor_registration.yml
- name: Perform Ironic node deconfiguration
import_playbook: node_enrolment.yml
- name: Deconfigure virtual node BMCs
import_playbook: node_bmc.yml
- name: De-instantiate nodes
import_playbook: node_instantiation.yml
- name: Deconfigure node networking
import_playbook: node_networking.yml
- name: Perform deployment host deconfiguration
import_playbook: host_setup.yml

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 101 KiB