fix: update nuke playbook to run tasks directly
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
1 file changed
+34
-6
@@ -55,12 +55,40 @@
|
||||
path: /etc/cni/net.d
|
||||
state: absent
|
||||
|
||||
- name: Uninstall Kubernetes
|
||||
ansible.builtin.include_role:
|
||||
name: xanmanning.k3s
|
||||
public: true
|
||||
vars:
|
||||
k3s_state: uninstalled
|
||||
- name: Check to see if k3s-killall.sh exits
|
||||
ansible.builtin.stat:
|
||||
path: /usr/local/bin/k3s-killall.sh
|
||||
register: check_k3s_killall_script
|
||||
|
||||
- name: Check to see if k3s-uninstall.sh exits
|
||||
ansible.builtin.stat:
|
||||
path: /usr/local/bin/k3s-uninstall.sh
|
||||
register: check_k3s_uninstall_script
|
||||
|
||||
- name: Run k3s-killall.sh
|
||||
when: check_k3s_killall_script.stat.exists
|
||||
ansible.builtin.command:
|
||||
cmd: /usr/local/bin/k3s-killall.sh
|
||||
register: k3s_killall
|
||||
changed_when: k3s_killall.rc == 0
|
||||
|
||||
- name: Run k3s-uninstall.sh
|
||||
when: check_k3s_uninstall_script.stat.exists
|
||||
ansible.builtin.command:
|
||||
cmd: /usr/local/bin/k3s-uninstall.sh
|
||||
args:
|
||||
removes: /usr/local/bin/k3s-uninstall.sh
|
||||
register: k3s_uninstall
|
||||
changed_when: k3s_uninstall.rc == 0
|
||||
|
||||
- name: Ensure hard links are removed
|
||||
when:
|
||||
- k3s_install_hard_links
|
||||
- not ansible_check_mode
|
||||
ansible.builtin.file:
|
||||
path: "{% raw %}{{ k3s_install_dir }}/{{ item }}{% endraw %}"
|
||||
state: absent
|
||||
loop: ["kubectl", "crictl", "ctr"]
|
||||
|
||||
- name: Stale Containers
|
||||
ansible.builtin.include_tasks: tasks/stale_containers.yaml
|
||||
|
||||
Reference in new issue
Block a user