2022-02-06 15:52:03 -06:00
|
|
|
- name: purge k3s from k3s-nodes
|
2022-02-09 10:31:53 -06:00
|
|
|
hosts: k3s-nodes
|
2022-02-03 14:05:56 -06:00
|
|
|
become: true
|
2022-02-07 21:07:07 -06:00
|
|
|
gather_facts: no
|
2022-02-03 14:05:56 -06:00
|
|
|
any_errors_fatal: true
|
|
|
|
tasks:
|
|
|
|
- name: Kill k3s
|
|
|
|
ansible.builtin.command: /usr/local/bin/k3s-killall.sh
|
|
|
|
- name: Uninstall k3s
|
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: /usr/local/bin/k3s-uninstall.sh
|
|
|
|
removes: /usr/local/bin/k3s-uninstall.sh
|
|
|
|
- name: Uninstall k3s agent
|
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: /usr/local/bin/k3s-agent-uninstall.sh
|
|
|
|
removes: /usr/local/bin/k3s-agent-uninstall.sh
|
|
|
|
- name: Gather list of CNI files to delete
|
|
|
|
find:
|
|
|
|
paths: /etc/cni/net.d
|
|
|
|
patterns: "*"
|
|
|
|
register: files_to_delete
|
|
|
|
- name: Delete CNI files
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ item.path }}"
|
|
|
|
state: absent
|
|
|
|
loop: "{{ files_to_delete.files }}"
|
2022-02-07 21:07:07 -06:00
|
|
|
|