diff --git a/contrib/ansible/reset.yml b/contrib/ansible/reset.yml new file mode 100644 index 0000000000..4dd5794272 --- /dev/null +++ b/contrib/ansible/reset.yml @@ -0,0 +1,7 @@ +--- + +- hosts: k3s-cluster + gather_facts: yes + become: yes + roles: + - { role: reset } diff --git a/contrib/ansible/roles/reset/tasks/main.yml b/contrib/ansible/roles/reset/tasks/main.yml new file mode 100644 index 0000000000..8bf8d08b00 --- /dev/null +++ b/contrib/ansible/roles/reset/tasks/main.yml @@ -0,0 +1,25 @@ +--- +- name: Disable services + systemd: + name: "{{ item }}" + state: stopped + enabled: no + with_items: + - k3s + - k3s-node + +- name: Remove service files, binaries and data + file: + name: "{{ item }}" + state: absent + with_items: + - "{{ systemd_dir }}/k3s.service" + - "{{ systemd_dir }}/k3s-node.service" + - /etc/rancher/k3s + - /var/lib/rancher/k3s + - /var/lib/kubelet + - /usr/local/bin/k3s + +- name: daemon_reload + systemd: + daemon_reload: yes