contrib/ansible: Add reset role and playbook to reset a node (#1565)

Signed-off-by: Julien DOCHE <julien.doche@gmail.com>
This commit is contained in:
Julien DOCHE 2020-03-25 20:36:28 +01:00 committed by GitHub
parent bb0b4db228
commit 3c98290f0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,7 @@
---
- hosts: k3s-cluster
gather_facts: yes
become: yes
roles:
- { role: reset }

View File

@ -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