Playbook for removing a broken OpenStack install
Change-Id: I2b3a5daade84446b06f63cbfefd994e41ea0ee2d
diff --git a/roles/teardown-openstack/tasks/main.yml b/roles/teardown-openstack/tasks/main.yml
new file mode 100644
index 0000000..857beb9
--- /dev/null
+++ b/roles/teardown-openstack/tasks/main.yml
@@ -0,0 +1,20 @@
+- name: Remove Juju directory
+ file:
+ path: "{{ ansible_user_dir }}/.juju"
+ state: absent
+
+- name: Remove containers for the OpenStack services
+ become: yes
+ lxd_container:
+ name: "{{ item.name }}"
+ state: absent
+ with_items: "{{ head_lxd_list }}"
+
+- name: Remove PKI directories
+ become: yes
+ file:
+ path: "{{ item }}"
+ state: absent
+ with_items:
+ - /opt/cord/build/platform-install/pki/intermediate_ca
+ - /opt/cord/build/platform-install/pki/root_ca
diff --git a/teardown-openstack-playbook.yml b/teardown-openstack-playbook.yml
new file mode 100644
index 0000000..9d15aa9
--- /dev/null
+++ b/teardown-openstack-playbook.yml
@@ -0,0 +1,16 @@
+---
+# teardown-openstack-playbook.yml
+
+- name: Include vars
+ hosts: all
+ tasks:
+ - name: Include variables
+ include_vars: "{{ item }}"
+ with_items:
+ - "profile_manifests/{{ cord_profile }}.yml"
+ - profile_manifests/local_vars.yml
+
+- name: Teardown CORD profile
+ hosts: head
+ roles:
+ - teardown-openstack