c12s-kubespray/roles/kubernetes/master/tasks/kubeadm-cleanup-old-certs.yml
mervynzhang a8dfcbbfc7 Switch /root references to ansible_env.HOME (#4842)
* kube config dir for current/ansible become user

* remove extra /

* fix default value
2019-06-06 02:06:11 -07:00

17 lines
425 B
YAML

---
- name: kubeadm | Retrieve files to purge
find:
paths: "{{ kube_cert_dir }}"
patterns: '*.pem'
register: files_to_purge_for_kubeadm
- name: kubeadm | Purge old certs
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ files_to_purge_for_kubeadm.files }}"
- name: kubeadm | Purge old kubeconfig
file:
path: "{{ ansible_env.HOME | default('/root') }}/.kube/config"
state: absent