32 lines
704 B
YAML
32 lines
704 B
YAML
- name: Disable swap
|
|
command: swapoff -a
|
|
when: ansible_swaptotal_mb|int > 0
|
|
|
|
- name: Ensure swap disabled on boot
|
|
replace:
|
|
path: /etc/fstab
|
|
regexp: '^([^#].*\sswap\s)'
|
|
replace: '# \1'
|
|
|
|
- name: Kernel modules
|
|
copy:
|
|
dest: /etc/modules-load.d/containerd.conf
|
|
content: |
|
|
overlay
|
|
br_netfilter
|
|
|
|
- name: Load modules
|
|
command: modprobe {{ item }}
|
|
loop: [overlay, br_netfilter]
|
|
|
|
- name: Sysctl for k8s
|
|
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
|
|
vm.max_map_count = 262144
|
|
- name: Apply sysctl
|
|
command: sysctl --system
|