feat(ansible): remove dep cilium-cli and update nuke playbook
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
3 files changed
+34
-43
No files matched your search
@@ -22,41 +22,45 @@
|
||||
ansible.builtin.pause:
|
||||
seconds: 5
|
||||
tasks:
|
||||
- name: Uninstall Cilium
|
||||
when:
|
||||
- k3s_control_node is defined
|
||||
- k3s_control_node
|
||||
ansible.builtin.shell: |
|
||||
cilium uninstall --wait
|
||||
environment:
|
||||
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
|
||||
- name: Stop Kubernetes
|
||||
ansible.builtin.include_role:
|
||||
name: xanmanning.k3s
|
||||
public: true
|
||||
vars:
|
||||
k3s_state: stopped
|
||||
|
||||
- name: Prevent k3s from starting on reboot
|
||||
ansible.builtin.systemd:
|
||||
name: k3s
|
||||
enabled: false
|
||||
# https://github.com/k3s-io/docs/blob/main/docs/installation/network-options.md
|
||||
- name: Networking
|
||||
block:
|
||||
- name: Networking | Delete Cilium links
|
||||
ansible.builtin.command:
|
||||
cmd: "ip link delete {{ item }}"
|
||||
removes: "/sys/class/net/{{ item }}"
|
||||
loop: ["cilium_host", "cilium_net", "cilium_vxlan"]
|
||||
- name: Networking | Flush iptables
|
||||
ansible.builtin.iptables:
|
||||
table: "{{ item }}"
|
||||
flush: true
|
||||
loop: ["filter", "nat", "mangle", "raw"]
|
||||
- name: Networking | Flush ip6tables
|
||||
ansible.builtin.iptables:
|
||||
table: "{{ item }}"
|
||||
flush: true
|
||||
ip_version: ipv6
|
||||
loop: ["filter", "nat", "mangle", "raw"]
|
||||
- name: Networking | Delete CNI directory
|
||||
ansible.builtin.file:
|
||||
path: /etc/cni/net.d
|
||||
state: absent
|
||||
|
||||
- name: Reboot
|
||||
ansible.builtin.reboot:
|
||||
msg: Rebooting nodes
|
||||
reboot_timeout: 3600
|
||||
|
||||
- name: Uninstall k3s
|
||||
- name: Uninstall Kubernetes
|
||||
ansible.builtin.include_role:
|
||||
name: xanmanning.k3s
|
||||
public: true
|
||||
vars:
|
||||
k3s_state: uninstalled
|
||||
|
||||
- name: Gather list of CNI files
|
||||
ansible.builtin.find:
|
||||
paths: /etc/cni/net.d
|
||||
patterns: "*"
|
||||
hidden: true
|
||||
register: directory_contents
|
||||
|
||||
- name: Delete CNI files
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
loop: "{{ directory_contents.files }}"
|
||||
- name: Reboot
|
||||
ansible.builtin.reboot:
|
||||
msg: Rebooting nodes
|
||||
reboot_timeout: 3600
|
||||
@@ -56,17 +56,6 @@
|
||||
notify: Reboot
|
||||
when: "'raspi' in ansible_kernel"
|
||||
|
||||
- name: Packages | Cilium CLI
|
||||
ansible.builtin.include_role:
|
||||
name: githubixx.cilium_cli
|
||||
public: true
|
||||
vars:
|
||||
cilium_cli_arch: "{{ 'amd64' if ansible_architecture == 'x86_64' else 'arm64' }}"
|
||||
cilium_cli_tmp_directory: /tmp
|
||||
when:
|
||||
- k3s_control_node is defined
|
||||
- k3s_control_node
|
||||
|
||||
- name: User Configuration
|
||||
block:
|
||||
- name: User Configuration | Add additional SSH public keys
|
||||
|
||||
@@ -11,8 +11,6 @@ collections:
|
||||
- name: kubernetes.core
|
||||
version: 2.4.0
|
||||
roles:
|
||||
- name: githubixx.cilium_cli
|
||||
version: 2.6.0+0.13.2
|
||||
- name: xanmanning.k3s
|
||||
src: https://github.com/PyratLabs/ansible-role-k3s.git
|
||||
version: v3.4.2
|
||||
Reference in new issue
Block a user