openstack-ansible-tests/destroy_containers.yml
Kevin Carter 54930c0048
Remove the serialization in tests
The lxc container create process were running in serial as it sets up
the test environment. Being this is setting up a test environment
there's no need for it to be executed in serial. The original reason
these container creates were running in serial was due to SSH issues
however the integrated repo has been creating containers in parallel for
sometime now so it is believed the original control path issues have
been resolved.

Change-Id: I59d563549b288e634338474aed45011e94b85c47
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-12-12 17:52:01 -06:00

58 lines
1.9 KiB
YAML

---
# Copyright 2015, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Playbook for destroying test containers
hosts: all_containers
become: true
gather_facts: false
tasks:
- name: Destroy a container
lxc_container:
name: "{{ container_name }}"
state: "absent"
delegate_to: "{{ physical_host }}"
tags:
- container-destroy
- name: Destroy container service directories
file:
path: "{{ item }}"
state: "absent"
with_items:
- "/openstack/{{ container_name }}"
- "/openstack/backup/{{ container_name }}"
- "/openstack/log/{{ container_name }}"
- "/var/lib/lxc/{{ container_name }}"
- "{{ lxc_container_directory|default('/var/lib/lxc') }}/{{ container_name }}"
- "/var/log/lxc/lxc-{{container_name}}"
delegate_to: "{{ physical_host }}"
tags:
- container-directories-service
- name: Destroy container data directories
file:
path: "{{ item }}"
state: "absent"
with_items:
- "/openstack/{{ container_name }}"
- "/openstack/backup/{{ container_name }}"
- "/openstack/log/{{ container_name }}"
delegate_to: "{{ physical_host }}"
when:
- force_containers_destroy | bool
- force_containers_data_destroy | bool
tags:
- container-directories-data
vars_files:
- test-vars.yml