summaryrefslogtreecommitdiffstats
path: root/ansible/roles
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
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')
-rw-r--r--ansible/roles/rancher/molecule/default/cleanup.yml10
-rw-r--r--ansible/roles/rancher/tasks/rancher_server.yml2
2 files changed, 6 insertions, 6 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'}
diff --git a/ansible/roles/rancher/tasks/rancher_server.yml b/ansible/roles/rancher/tasks/rancher_server.yml
index 4cda3722..a0893b0b 100644
--- a/ansible/roles/rancher/tasks/rancher_server.yml
+++ b/ansible/roles/rancher/tasks/rancher_server.yml
@@ -55,7 +55,7 @@
account_key: "{{ key_public }}:{{ key_private }}"
mode: access_control
data:
- account_id: 1a1 # default rancher admin account
+ account_id: 1a1 # default rancher admin account
password: "{{ rancher.admin_password }}"
when: "rancher.auth_enabled is defined and rancher.auth_enabled"