diff options
| author | Mauricio Lima <mauriciolimab@gmail.com> | 2016-04-08 14:40:25 -0400 |
|---|---|---|
| committer | Mauricio Lima <mauriciolimab@gmail.com> | 2016-04-19 10:00:59 -0400 |
| commit | 8588bd655e6160f0ce4f98eab2f3bd15afffc8c4 (patch) | |
| tree | df728243067f362760eb3c8d94765b5928bc6fd4 /ansible | |
| parent | fda9444ea63ec436e7598ebb4ce221db0dd5d97d (diff) | |
| download | kolla-8588bd655e6160f0ce4f98eab2f3bd15afffc8c4.tar.gz kolla-8588bd655e6160f0ce4f98eab2f3bd15afffc8c4.zip | |
Add a role to cleanup containers after deployment
Change-Id: I5f422574d7e50ec9a1e5862b66ecbf39fe1594d2
Closes-Bug: #1531721
Implements: blueprint ansible-cleanup-role
Diffstat (limited to 'ansible')
| -rw-r--r-- | ansible/cleanup.yml | 4 | ||||
| -rw-r--r-- | ansible/roles/cleanup/tasks/cleanup_containers.yml | 3 | ||||
| -rw-r--r-- | ansible/roles/cleanup/tasks/cleanup_host.yml | 6 | ||||
| -rw-r--r-- | ansible/roles/cleanup/tasks/copy_tools.yml | 23 | ||||
| -rw-r--r-- | ansible/roles/cleanup/tasks/main.yml | 6 |
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 |
