From 3c336375bf7b377a070250f684b5bc61687fc1e5 Mon Sep 17 00:00:00 2001
From: Andrew Butcher <abutcher@redhat.com>
Date: Tue, 6 Jun 2017 15:51:29 -0400
Subject: Separate client config removal in uninstall s.t. ansible_ssh_user is
 removed from with_items.

---
 playbooks/adhoc/uninstall.yml | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/playbooks/adhoc/uninstall.yml b/playbooks/adhoc/uninstall.yml
index 1c8257162..97d835eae 100644
--- a/playbooks/adhoc/uninstall.yml
+++ b/playbooks/adhoc/uninstall.yml
@@ -393,10 +393,19 @@
     - "{{ directories.results | default([]) }}"
     - files
 
+  - set_fact:
+      client_users: "{{ [ansible_ssh_user, 'root'] | unique }}"
+
+  - name: Remove client kubeconfigs
+    file:
+      path: "~{{ item }}/.kube"
+      state: absent
+    with_items:
+    - "{{ client_users }}"
+
   - name: Remove remaining files
     file: path={{ item }} state=absent
     with_items:
-    - "~{{ ansible_ssh_user }}/.kube"
     - /etc/ansible/facts.d/openshift.fact
     - /etc/atomic-enterprise
     - /etc/corosync
@@ -421,7 +430,6 @@
     - /etc/sysconfig/origin-master
     - /etc/sysconfig/origin-master-api
     - /etc/sysconfig/origin-master-controllers
-    - /root/.kube
     - /usr/share/openshift/examples
     - /var/lib/atomic-enterprise
     - /var/lib/openshift
-- 
cgit v1.2.3