-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.yaml
35 lines (30 loc) · 937 Bytes
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
- name: enable br_netfilter module
ansible.builtin.copy:
dest: /etc/modules-load.d/k8s.conf
content: |
overlay
br_netfilter
notify: reload sysctl
- ansible.builtin.shell: modprobe overlay
- ansible.builtin.shell: modprobe br_netfilter
- name: enable iptables for bridged traffic
ansible.builtin.copy:
dest: /etc/sysctl.d/k8s.conf
content: |
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
notify: reload sysctl
- name: disable swap
ansible.builtin.shell: swapoff -a
register: swapoff
changed_when: swapoff.stdout != ""
- name: Disable swap permanently, persist reboots
replace:
path: /etc/fstab
regexp: '^(\s*)([^#\n]+\s+)(\w+\s+)swap(\s+.*)$'
replace: '#\1\2\3swap\4'
backup: yes
- import_tasks: "{{ container_runtime | default('containerd') }}.yaml"
- import_tasks: kube.yaml