initial commit
This commit is contained in:
40
ansible/playbooks/01-common.yml
Normal file
40
ansible/playbooks/01-common.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
- name: Common OS prerequisites for all k8s nodes
|
||||
hosts: k8s
|
||||
become: true
|
||||
|
||||
tasks:
|
||||
- name: Disable swap now
|
||||
command: swapoff -a
|
||||
when: ansible_facts['swaptotal_mb'] > 0
|
||||
|
||||
- name: Remove swap from /etc/fstab
|
||||
replace:
|
||||
path: /etc/fstab
|
||||
regexp: '^([^#].*\s+swap\s+.*)$'
|
||||
replace: '# \1'
|
||||
|
||||
- name: Load kernel modules at boot
|
||||
copy:
|
||||
dest: /etc/modules-load.d/k8s.conf
|
||||
content: |
|
||||
overlay
|
||||
br_netfilter
|
||||
|
||||
- name: Load kernel modules now
|
||||
modprobe:
|
||||
name: "{{ item }}"
|
||||
loop:
|
||||
- overlay
|
||||
- br_netfilter
|
||||
|
||||
- name: Set sysctl for k8s networking
|
||||
copy:
|
||||
dest: /etc/sysctl.d/k8s.conf
|
||||
content: |
|
||||
net.bridge.bridge-nf-call-iptables = 1
|
||||
net.bridge.bridge-nf-call-ip6tables = 1
|
||||
net.ipv4.ip_forward = 1
|
||||
|
||||
- name: Apply sysctl
|
||||
command: sysctl --system
|
||||
Reference in New Issue
Block a user