summaryrefslogtreecommitdiffstats
path: root/ansible/roles/rancher/molecule
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-04-26 13:26:45 +0200
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-04-26 15:43:11 +0200
commitee157b53be7c176081aed96a74fe8ff09b208cb8 (patch)
tree12af04e01a5753136ce0cff60fd5cedfa009a63a /ansible/roles/rancher/molecule
parentcb94aefb4ef22fdf435578e676823a6b9600cbb9 (diff)
Cleanup Rancher containers after Molecule converge
Rancher role test do remove rancher/agent and rancher/server containers at 'cleanup' stage but Rancher Agent spawned containers are left orphaned. This patch adds tasks to remove them. This patch also adds custom ansible module for listing docker containers (as of ansible 2.7.10 no upstream module provides that feature, even new docker_container_info info module in ansible's devel branch doesn't have it) Change-Id: I6325dc81063b55b70136280273f8f6138c7a0375 Issue-ID: OOM-1811 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'ansible/roles/rancher/molecule')
-rw-r--r--ansible/roles/rancher/molecule/default/cleanup.yml10
1 files changed, 5 insertions, 5 deletions
diff --git a/ansible/roles/rancher/molecule/default/cleanup.yml b/ansible/roles/rancher/molecule/default/cleanup.yml
index 13b48278..d4bf4495 100644
--- a/ansible/roles/rancher/molecule/default/cleanup.yml
+++ b/ansible/roles/rancher/molecule/default/cleanup.yml
@@ -7,8 +7,8 @@
container_list:
- rancher-agent
- rancher-server
- # For some reason getting error "Device busy error" when trying to delete directory with root privileges and rancher-containers not anymore running.
- # - role: cleanup-directories
- # vars:
- # directories_files_list_to_remove:
- # - /var/lib/rancher/
+ - role: cleanup-rancher
+ vars:
+ container_list_by_label:
+ - { 'label':'io.rancher.project.name', 'value':'healthcheck'}
+ - { 'label':'io.rancher.project.name', 'value':'kubernetes'}