initial commit

This commit is contained in:
2026-06-14 14:21:09 +07:00
commit 054835e2a7
17 changed files with 771 additions and 0 deletions

View 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