abril/roles/reset/tasks/main.yml
Techno Tim aa05ab153e
fix(ansible): Refactored ansible steps to now install metallb in post… (#58)
* fix(ansible): Refactored ansible steps to now install metallb in post task and verify
2022-08-28 14:25:09 -05:00

65 lines
1.4 KiB
YAML

---
- name: Disable services
systemd:
name: "{{ item }}"
state: stopped
enabled: no
failed_when: false
with_items:
- k3s
- k3s-node
- k3s-init
- name: RUN pkill -9 -f "k3s/data/[^/]+/bin/containerd-shim-runc"
register: pkill_containerd_shim_runc
command: pkill -9 -f "k3s/data/[^/]+/bin/containerd-shim-runc"
changed_when: "pkill_containerd_shim_runc.rc == 0"
failed_when: false
- name: Umount k3s filesystems
include_tasks: umount_with_children.yml
with_items:
- /run/k3s
- /var/lib/kubelet
- /run/netns
- /var/lib/rancher/k3s
- /var/lib/kubelet/pods
- /var/lib/kubelet/plugins
- /run/netns/cni-
loop_control:
loop_var: mounted_fs
- name: Remove service files, binaries and data
file:
name: "{{ item }}"
state: absent
with_items:
- /usr/local/bin/k3s
- "{{ systemd_dir }}/k3s.service"
- "{{ systemd_dir }}/k3s-node.service"
- /etc/rancher/k3s
- /run/k3s
- /run/flannel
- /etc/rancher/
- /var/lib/kubelet
- /var/lib/rancher/k3s
- /var/lib/rancher/
- /usr/local/bin/k3s
- /var/lib/cni/
- name: Reload daemon_reload
systemd:
daemon_reload: yes
- name: Remove linux-modules-extra-raspi
apt: name=linux-modules-extra-raspi state=absent
- name: Remove tmp director used for manifests
file:
path: /tmp/k3s
state: absent
- name: Reboot and wait for node to come back up
reboot:
reboot_timeout: 3600