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:
|
ansible.builtin.pause:
|
||||||
seconds: 5
|
seconds: 5
|
||||||
tasks:
|
tasks:
|
||||||
- name: Uninstall Cilium
|
- name: Stop Kubernetes
|
||||||
when:
|
ansible.builtin.include_role:
|
||||||
- k3s_control_node is defined
|
name: xanmanning.k3s
|
||||||
- k3s_control_node
|
public: true
|
||||||
ansible.builtin.shell: |
|
vars:
|
||||||
cilium uninstall --wait
|
k3s_state: stopped
|
||||||
environment:
|
|
||||||
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
|
|
||||||
|
|
||||||
- name: Prevent k3s from starting on reboot
|
# https://github.com/k3s-io/docs/blob/main/docs/installation/network-options.md
|
||||||
ansible.builtin.systemd:
|
- name: Networking
|
||||||
name: k3s
|
block:
|
||||||
enabled: false
|
- 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
|
- name: Uninstall Kubernetes
|
||||||
ansible.builtin.reboot:
|
|
||||||
msg: Rebooting nodes
|
|
||||||
reboot_timeout: 3600
|
|
||||||
|
|
||||||
- name: Uninstall k3s
|
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: xanmanning.k3s
|
name: xanmanning.k3s
|
||||||
public: true
|
public: true
|
||||||
vars:
|
vars:
|
||||||
k3s_state: uninstalled
|
k3s_state: uninstalled
|
||||||
|
|
||||||
- name: Gather list of CNI files
|
- name: Reboot
|
||||||
ansible.builtin.find:
|
ansible.builtin.reboot:
|
||||||
paths: /etc/cni/net.d
|
msg: Rebooting nodes
|
||||||
patterns: "*"
|
reboot_timeout: 3600
|
||||||
hidden: true
|
|
||||||
register: directory_contents
|
|
||||||
|
|
||||||
- name: Delete CNI files
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ item.path }}"
|
|
||||||
state: absent
|
|
||||||
loop: "{{ directory_contents.files }}"
|
|
||||||
@@ -56,17 +56,6 @@
|
|||||||
notify: Reboot
|
notify: Reboot
|
||||||
when: "'raspi' in ansible_kernel"
|
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
|
- name: User Configuration
|
||||||
block:
|
block:
|
||||||
- name: User Configuration | Add additional SSH public keys
|
- name: User Configuration | Add additional SSH public keys
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ collections:
|
|||||||
- name: kubernetes.core
|
- name: kubernetes.core
|
||||||
version: 2.4.0
|
version: 2.4.0
|
||||||
roles:
|
roles:
|
||||||
- name: githubixx.cilium_cli
|
|
||||||
version: 2.6.0+0.13.2
|
|
||||||
- name: xanmanning.k3s
|
- name: xanmanning.k3s
|
||||||
src: https://github.com/PyratLabs/ansible-role-k3s.git
|
src: https://github.com/PyratLabs/ansible-role-k3s.git
|
||||||
version: v3.4.2
|
version: v3.4.2
|
||||||
Reference in new issue
Block a user