geerlingguy/ansible-role-kubernetes

sysctl-setup.yml doesn't recognize Ubuntu 20.04

ea-p opened this issue · 13 comments

ea-p commented

Received this error while using this role to install k8s on an ubuntu 20.04 server.

{
"msg": "Failed to reload sysctl: kernel.panic = 10\nnet.ipv6.conf.all.disable_ipv6 = 1\nsysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: No such file or directory\n",
"invocation": {
"module_args": {
"name": "net.bridge.bridge-nf-call-iptables",
"value": "1",
"state": "present",
"reload": true,
"sysctl_set": false,
"ignoreerrors": false,
"sysctl_file": "/etc/sysctl.conf"
}
},
"_ansible_no_log": false,
"changed": false,
"item": "net.bridge.bridge-nf-call-iptables",
"ansible_loop_var": "item",
"_ansible_item_label": "net.bridge.bridge-nf-call-iptables"
}

This is from the server:
"ansible_distribution": "Ubuntu",
"ansible_distribution_file_parsed": true,
"ansible_distribution_file_path": "/etc/os-release",
"ansible_distribution_file_variety": "Debian",
"ansible_distribution_major_version": "20",
"ansible_distribution_release": "focal",
"ansible_distribution_version": "20.04",

Maybe switch from "ansible_distribution" to "ansible_os_family": "Debian"

Strangely, I'm also running into this on Debian 10 over in geerlingguy/raspberry-pi-dramble#187

stale commented

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

rdxmb commented

not stale, see existing PR

stale commented

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

rdxmb commented

/reopen please

stale commented

This issue is no longer marked for closure.

stale commented

This issue is no longer marked for closure.

I'm using this role in CentOS 7 on Vagrant (centos/7 box) and I'm stepping in the same problem with sysctl-setup.yml

I only had to add the following before the "Let iptables see bridged traffic." step

- name: Ensure br_netfilter is enabled.
  modprobe:
    name: br_netfilter
    state: present
  when: >
    ansible_distribution != 'Debian'
    or ansible_distribution_major_version | int < 10

I also added this to the loop to the mentioned step

    - net.ipv4.ip_forward

The rest of the changes in the PR seem to be optional.

Hat's off to @geerlingguy on this tool though, thank you! Next time I'm in Saint Louis let me buy you a beer 🍻

I'm hitting this just now with latest from master. Trying to get a Kubernetes 1.25 cluster going
I'm using Ubuntu Server 22.04 LTS (ansible_distribution=Ubuntu ansible_distribution_major_version=22)

  - name: geerlingguy.containerd
    version: 1.3.0

  - src: https://github.com/geerlingguy/ansible-role-kubernetes
    name: geerlingguy.kubernetes
    version: master

was there an existing PR that fixes this?

I'm using Ubuntu Server 22.04 LTS (ansible_distribution=Ubuntu ansible_distribution_major_version=22)

I faced the same problem.

I can't find it, so I have created a PR #139 .

piky commented

I only had to add the following before the "Let iptables see bridged traffic." step

- name: Ensure br_netfilter is enabled.
  modprobe:
    name: br_netfilter
    state: present
  when: >
    ansible_distribution != 'Debian'
    or ansible_distribution_major_version | int < 10

I also added this to the loop to the mentioned step

    - net.ipv4.ip_forward

The rest of the changes in the PR seem to be optional.

Hat's off to @geerlingguy on this tool though, thank you! Next time I'm in Saint Louis let me buy you a beer 🍻

It works like a charm!
Any PR with this solution?