aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-04-27 17:21:46 +0000
committerGerrit Code Review <review@openstack.org>2016-04-27 17:21:46 +0000
commita22b7714e3147a4938b3a69d84640f847653ecbe (patch)
tree6fb165812b8201a8bc90c24c4e0ecbe29df5a8a2 /ansible
parent9610ce7a9ecb8e191a5a998b8a8dfafd7e918085 (diff)
parent8588bd655e6160f0ce4f98eab2f3bd15afffc8c4 (diff)
downloadkolla-a22b7714e3147a4938b3a69d84640f847653ecbe.tar.gz
kolla-a22b7714e3147a4938b3a69d84640f847653ecbe.zip
Merge "Add a role to cleanup containers after deployment"
Diffstat (limited to 'ansible')
-rw-r--r--ansible/cleanup.yml4
-rw-r--r--ansible/roles/cleanup/tasks/cleanup_containers.yml3
-rw-r--r--ansible/roles/cleanup/tasks/cleanup_host.yml6
-rw-r--r--ansible/roles/cleanup/tasks/copy_tools.yml23
-rw-r--r--ansible/roles/cleanup/tasks/main.yml6
5 files changed, 42 insertions, 0 deletions
diff --git a/ansible/cleanup.yml b/ansible/cleanup.yml
new file mode 100644
index 000000000..14d5668cf
--- /dev/null
+++ b/ansible/cleanup.yml
@@ -0,0 +1,4 @@
+---
+- hosts: all
+ roles:
+ - cleanup
diff --git a/ansible/roles/cleanup/tasks/cleanup_containers.yml b/ansible/roles/cleanup/tasks/cleanup_containers.yml
new file mode 100644
index 000000000..1de152267
--- /dev/null
+++ b/ansible/roles/cleanup/tasks/cleanup_containers.yml
@@ -0,0 +1,3 @@
+---
+- name: Cleaning all containers and volumes
+ command: /tmp/kolla-cleanup/tools/cleanup-containers
diff --git a/ansible/roles/cleanup/tasks/cleanup_host.yml b/ansible/roles/cleanup/tasks/cleanup_host.yml
new file mode 100644
index 000000000..36a65fb79
--- /dev/null
+++ b/ansible/roles/cleanup/tasks/cleanup_host.yml
@@ -0,0 +1,6 @@
+---
+- name: Cleaning host
+ command: /tmp/kolla-cleanup/tools/cleanup-host
+
+- name: Removing kolla-cleanup folder
+ command: rm -rf /tmp/kolla-cleanup
diff --git a/ansible/roles/cleanup/tasks/copy_tools.yml b/ansible/roles/cleanup/tasks/copy_tools.yml
new file mode 100644
index 000000000..737233c8e
--- /dev/null
+++ b/ansible/roles/cleanup/tasks/copy_tools.yml
@@ -0,0 +1,23 @@
+---
+- name: Creating /kolla-cleanup/tools directory on node
+ file:
+ state: directory
+ path: /tmp/kolla-cleanup/tools
+
+- name: Copying validate-docker-execute.sh file
+ copy:
+ src: ../tools/validate-docker-execute.sh
+ dest: /tmp/kolla-cleanup/tools
+ mode: 0755
+
+- name: Copying cleanup-containers file
+ copy:
+ src: ../tools/cleanup-containers
+ dest: /tmp/kolla-cleanup/tools
+ mode: 0755
+
+- name: Copying cleanup-host file
+ copy:
+ src: ../tools/cleanup-host
+ dest: /tmp/kolla-cleanup/tools
+ mode: 0755
diff --git a/ansible/roles/cleanup/tasks/main.yml b/ansible/roles/cleanup/tasks/main.yml
new file mode 100644
index 000000000..d7f8b1e1e
--- /dev/null
+++ b/ansible/roles/cleanup/tasks/main.yml
@@ -0,0 +1,6 @@
+---
+- include: copy_tools.yml
+
+- include: cleanup_containers.yml
+
+- include: cleanup_host.yml