improve sysctl-setup for Ubuntu

This commit is contained in:
rhino5oh 2022-12-08 17:24:20 -05:00
parent 4a4c88b6b8
commit 2bb01f3a05

View File

@ -1,5 +1,12 @@
--- ---
- name: Ensure procps is installed. - block:
- name: Enable br_netfilter module
modprobe:
name: br_netfilter
state: present
- name: Ensure procps is installed.
package: package:
name: "{{ procps_package }}" name: "{{ procps_package }}"
state: present state: present
@ -7,15 +14,20 @@
ansible_distribution != 'Debian' ansible_distribution != 'Debian'
or ansible_distribution_major_version | int < 10 or ansible_distribution_major_version | int < 10
# See: https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#letting-iptables-see-bridged-traffic # See: https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#letting-iptables-see-bridged-traffic
- name: Let iptables see bridged traffic. - name: Let iptables see bridged traffic.
sysctl: sysctl:
name: "{{ item }}" name: "{{ item }}"
value: '1' value: '1'
state: present state: present
loop: loop:
- net.ipv4.ip_forward
- net.bridge.bridge-nf-call-iptables - net.bridge.bridge-nf-call-iptables
- net.bridge.bridge-nf-call-ip6tables - net.bridge.bridge-nf-call-ip6tables
when: > when: >
ansible_distribution != 'Debian' ansible_distribution != 'Debian'
or ansible_distribution_major_version | int < 10 or ansible_distribution_major_version | int < 10
become: yes
become_user: root
become_method: sudo