2023-01-30 19:46:09 +01:00
|
|
|
---
|
|
|
|
- name: Undo cluster setup
|
|
|
|
hosts: k3s_cluster
|
|
|
|
gather_facts: true
|
|
|
|
become: true
|
2023-11-09 01:26:26 +01:00
|
|
|
tasks:
|
2023-11-11 00:17:13 +01:00
|
|
|
- name: Run K3s Uninstall script [server]
|
|
|
|
when: "'server' in group_names"
|
2023-11-09 01:26:26 +01:00
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: k3s-uninstall.sh
|
|
|
|
removes: /var/lib/rancher/k3s/*
|
2023-11-11 00:17:13 +01:00
|
|
|
- name: Run K3s Uninstall script [agent]
|
|
|
|
when: "'agent' in group_names"
|
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: k3s-agent-uninstall.sh
|
|
|
|
removes: /var/lib/rancher/k3s/*
|
2023-11-09 01:26:26 +01:00
|
|
|
- name: Remove user kubeconfig
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: /home/{{ ansible_user }}/.kube/config
|
|
|
|
state: absent
|