diff --git a/tasks/sysctl-setup.yml b/tasks/sysctl-setup.yml index f6332fd..174ebca 100644 --- a/tasks/sysctl-setup.yml +++ b/tasks/sysctl-setup.yml @@ -1,13 +1,21 @@ --- -# See: https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#letting-iptables-see-bridged-traffic -- name: Set sysctl for IPv4 bridges - sysctl: - name: net.bridge.bridge-nf-call-iptables - value: '1' +- name: Ensure procps is installed. + package: + name: "{{ procps_package }}" state: present + when: > + ansible_distribution != 'Debian' + or ansible_distribution_major_version | int < 10 -- name: Set sysctl for IPv6 bridges +# See: https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#letting-iptables-see-bridged-traffic +- name: Let iptables see bridged traffic. sysctl: - name: net.bridge.bridge-nf-call-ip6tables + name: "{{ item }}" value: '1' state: present + loop: + - net.bridge.bridge-nf-call-iptables + - net.bridge.bridge-nf-call-ip6tables + when: > + ansible_distribution != 'Debian' + or ansible_distribution_major_version | int < 10 diff --git a/vars/Debian.yml b/vars/Debian.yml index 67f5eae..8b8d1a2 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -1,2 +1,3 @@ --- +procps_package: procps kubelet_environment_file_path: /etc/default/kubelet diff --git a/vars/RedHat.yml b/vars/RedHat.yml index db8b7ac..e156651 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -1,4 +1,5 @@ --- +procps_package: procps-ng kubelet_environment_file_path: /etc/sysconfig/kubelet kubernetes_packages: - name: kubelet-{{ kubernetes_version_rhel_package }}-0