mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2024-09-24 03:22:43 +02:00
CentOS/RHEL compatibility for Ansible roles
- Setting IPv4 & IPv6 forwarding - Setting `sysctl:net.bridge.bridge-nf-call-iptables` and `bridge-nf-call-ip6tables` to enabled since it is disabled by default on some CentOS systems
This commit is contained in:
parent
830a191af9
commit
2b10d43fa1
@ -8,7 +8,7 @@ Build a Kubernetes cluster using Ansible with k3s. The goal is easily install a
|
||||
|
||||
- [X] Debian
|
||||
- [ ] Ubuntu
|
||||
- [ ] CentOS
|
||||
- [X] CentOS
|
||||
|
||||
on processor architecture:
|
||||
|
||||
|
35
roles/prereq/tasks/main.yml
Normal file
35
roles/prereq/tasks/main.yml
Normal file
@ -0,0 +1,35 @@
|
||||
---
|
||||
- name: Set SELinux to disabled state
|
||||
selinux:
|
||||
state: disabled
|
||||
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
|
||||
|
||||
- name: Enable IPv4 forwarding
|
||||
sysctl:
|
||||
name: net.ipv4.ip_forward
|
||||
value: "1"
|
||||
state: present
|
||||
reload: yes
|
||||
|
||||
- name: Enable IPv6 forwarding
|
||||
sysctl:
|
||||
name: net.ipv6.conf.all.forwarding
|
||||
value: "1"
|
||||
state: present
|
||||
reload: yes
|
||||
|
||||
- name: Set bridge-nf-call-iptables (just to be sure)
|
||||
sysctl:
|
||||
name: net.bridge.bridge-nf-call-iptables
|
||||
value: "1"
|
||||
state: present
|
||||
reload: yes
|
||||
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
|
||||
|
||||
- name: Set bridge-nf-call-ip6tables (just to be sure)
|
||||
sysctl:
|
||||
name: net.bridge.bridge-nf-call-iptables
|
||||
value: "1"
|
||||
state: present
|
||||
reload: yes
|
||||
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
|
Loading…
Reference in New Issue
Block a user