From 749d2869afec3f4fdaf0917f317c6016676feecd Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 1 Sep 2020 11:30:53 -0500 Subject: [PATCH] PR #75 follow-up: Move sysctl setup into separate task file. --- tasks/main.yml | 14 +------------- tasks/sysctl-setup.yml | 13 +++++++++++++ 2 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 tasks/sysctl-setup.yml diff --git a/tasks/main.yml b/tasks/main.yml index 0c3443c..1227585 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -18,19 +18,7 @@ notify: restart kubelet with_items: "{{ kubernetes_packages }}" -# per the install doc, -# https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/ -- name: Set sysctl for IPv4 bridges - sysctl: - name: net.bridge.bridge-nf-call-iptables - value: '1' - state: present - -- name: Set sysctl for IPv6 bridges - sysctl: - name: net.bridge.bridge-nf-call-ip6tables - value: '1' - state: present +- include_tasks: sysctl-setup.yml - include_tasks: kubelet-setup.yml diff --git a/tasks/sysctl-setup.yml b/tasks/sysctl-setup.yml new file mode 100644 index 0000000..f6332fd --- /dev/null +++ b/tasks/sysctl-setup.yml @@ -0,0 +1,13 @@ +--- +# 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' + state: present + +- name: Set sysctl for IPv6 bridges + sysctl: + name: net.bridge.bridge-nf-call-ip6tables + value: '1' + state: present