- name: Remove swap and zram packages ansible.builtin.apt: name: - dphys-swapfile - rpi-swap - systemd-zram-generator state: absent purge: true notify: Reboot - name: Turn off any active swap now ansible.builtin.command: swapoff -a when: ansible_facts['swaptotal_mb'] > 0 - name: Enable memory cgroups on the kernel command line ansible.builtin.lineinfile: path: /boot/firmware/cmdline.txt backrefs: true regexp: '^((?!.*cgroup_enable=memory).*)$' line: '\1 cgroup_enable=memory cgroup_memory=1' notify: Reboot - name: Load kernel modules at boot ansible.builtin.copy: dest: /etc/modules-load.d/kubernetes.conf content: | overlay br_netfilter mode: "0644" notify: Reboot - name: Kernel settings for Kubernetes networking ansible.builtin.copy: dest: /etc/sysctl.d/99-kubernetes.conf content: | net.bridge.bridge-nf-call-iptables = 1 net.bridge.bridge-nf-call-ip6tables = 1 net.ipv4.ip_forward = 1 mode: "0644" notify: Reboot - name: Install kernel headers meta-package (Falco builds its kmod driver against them) ansible.builtin.apt: name: linux-headers-rpi-2712 state: present