Merge "Optimise the destroy role by script module"

This commit is contained in:
Zuul 2018-03-09 15:50:10 +00:00 committed by Gerrit Code Review
commit a9f20f82c0
6 changed files with 12 additions and 50 deletions

View File

@ -1,3 +1,3 @@
---
- name: Destroying all Kolla containers and volumes
command: /tmp/kolla-cleanup/tools/cleanup-containers
script: ../tools/cleanup-containers

View File

@ -1,17 +1,12 @@
---
- name: Destroying Kolla host configuration
become: true
command: >
env enable_haproxy={{ enable_haproxy }}
enable_swift={{ enable_swift }}
glance_file_datadir_volume={{ glance_file_datadir_volume }}
kolla_internal_vip_address={{ kolla_internal_vip_address }}
kolla_external_vip_address={{ kolla_external_vip_address }}
kolla_dev_repos_directory={{ kolla_dev_repos_directory }}
destroy_include_dev={{ destroy_include_dev }}
/tmp/kolla-cleanup/tools/cleanup-host
- name: Destroying kolla-cleanup folder
file:
path: /tmp/kolla-cleanup
state: absent
script: ../tools/cleanup-host
environment:
enable_haproxy: "{{ enable_haproxy }}"
enable_swift: "{{ enable_swift }}"
glance_file_datadir_volume: "{{ glance_file_datadir_volume }}"
kolla_internal_vip_address: "{{ kolla_internal_vip_address }}"
kolla_external_vip_address: "{{ kolla_external_vip_address }}"
kolla_dev_repos_directory: "{{ kolla_dev_repos_directory }}"
destroy_include_dev: "{{ destroy_include_dev }}"

View File

@ -1,5 +1,5 @@
---
- name: Removing Kolla images
command: /tmp/kolla-cleanup/tools/cleanup-images --all
script: ../tools/cleanup-images --all
when:
- destroy_include_images | bool

View File

@ -1,31 +0,0 @@
---
- 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
- name: Copying cleanup-images file
copy:
src: ../tools/cleanup-images
dest: /tmp/kolla-cleanup/tools
mode: 0755
when:
- destroy_include_images | bool

View File

@ -1,6 +1,4 @@
---
- include: copy_tools.yml
- include: validate_docker_execute.yml
- include: cleanup_containers.yml

View File

@ -1,3 +1,3 @@
---
- name: Ensure the docker service is running
command: /tmp/kolla-cleanup/tools/validate-docker-execute.sh
script: ../tools/validate-docker-execute.sh