What happened:
While trying to deploy an all-in-one instance using Kolla-ansible, the Ansible scripts failed with the following error message:
TASK [neutron : Setting sysctl values] **************************************************************************************************************************************************
ok: [10.140.145.117] => (item={'name': 'net.ipv4.ip_forward', 'value': 1}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "net.ipv4.ip_forward", "value": 1}}
ok: [10.140.145.117] => (item={'name': 'net.ipv4.conf.all.rp_filter', 'value': 0}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "net.ipv4.conf.all.rp_filter", "value": 0}}
ok: [10.140.145.117] => (item={'name': 'net.ipv4.conf.default.rp_filter', 'value': 0}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "net.ipv4.conf.default.rp_filter", "value": 0}}
ok: [10.140.145.117] => (item={'name': 'net.ipv4.neigh.default.gc_thresh1', 'value': 128}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "net.ipv4.neigh.default.gc_thresh1", "value": 128}}
ok: [10.140.145.117] => (item={'name': 'net.ipv4.neigh.default.gc_thresh2', 'value': 28672}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "net.ipv4.neigh.default.gc_thresh2", "value": 28672}}
ok: [10.140.145.117] => (item={'name': 'net.ipv4.neigh.default.gc_thresh3', 'value': 32768}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "net.ipv4.neigh.default.gc_thresh3", "value": 32768}}
failed: [10.140.145.117] (item={'name': 'net.ipv6.neigh.default.gc_thresh1', 'value': '128'}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "net.ipv6.neigh.default.gc_thresh1", "value": "128"}, "msg": "Failed to reload sysctl: net.bridge.bridge-nf-call-iptables = 1\nnet.bridge.bridge-nf-call-ip6tables = 1\nnet.ipv4.conf.all.rp_filter = 0\nnet.ipv4.conf.default.rp_filter = 0\nnet.ipv4.ip_forward = 1\nnet.ipv4.neigh.default.gc_thresh1 = 128\nnet.ipv4.neigh.default.gc_thresh2 = 28672\nnet.ipv4.neigh.default.gc_thresh3 = 32768\nsysctl: cannot stat /proc/sys/net/ipv6/neigh/default/gc_thresh1: No such file or directory\nsysctl: cannot stat /proc/sys/net/ipv6/neigh/default/gc_thresh2: No such file or directory\nsysctl: cannot stat /proc/sys/net/ipv6/neigh/default/gc_thresh3: No such file or directory\n"}
failed: [10.140.145.117] (item={'name': 'net.ipv6.neigh.default.gc_thresh2', 'value': '28672'}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "net.ipv6.neigh.default.gc_thresh2", "value": "28672"}, "msg": "Failed to reload sysctl: net.bridge.bridge-nf-call-iptables = 1\nnet.bridge.bridge-nf-call-ip6tables = 1\nnet.ipv4.conf.all.rp_filter = 0\nnet.ipv4.conf.default.rp_filter = 0\nnet.ipv4.ip_forward = 1\nnet.ipv4.neigh.default.gc_thresh1 = 128\nnet.ipv4.neigh.default.gc_thresh2 = 28672\nnet.ipv4.neigh.default.gc_thresh3 = 32768\nsysctl: cannot stat /proc/sys/net/ipv6/neigh/default/gc_thresh1: No such file or directory\nsysctl: cannot stat /proc/sys/net/ipv6/neigh/default/gc_thresh2: No such file or directory\nsysctl: cannot stat /proc/sys/net/ipv6/neigh/default/gc_thresh3: No such file or directory\n"}
failed: [10.140.145.117] (item={'name': 'net.ipv6.neigh.default.gc_thresh3', 'value': '32768'}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "net.ipv6.neigh.default.gc_thresh3", "value": "32768"}, "msg": "Failed to reload sysctl: net.bridge.bridge-nf-call-iptables = 1\nnet.bridge.bridge-nf-call-ip6tables = 1\nnet.ipv4.conf.all.rp_filter = 0\nnet.ipv4.conf.default.rp_filter = 0\nnet.ipv4.ip_forward = 1\nnet.ipv4.neigh.default.gc_thresh1 = 128\nnet.ipv4.neigh.default.gc_thresh2 = 28672\nnet.ipv4.neigh.default.gc_thresh3 = 32768\nsysctl: cannot stat /proc/sys/net/ipv6/neigh/default/gc_thresh1: No such file or directory\nsysctl: cannot stat /proc/sys/net/ipv6/neigh/default/gc_thresh2: No such file or directory\nsysctl: cannot stat /proc/sys/net/ipv6/neigh/default/gc_thresh3: No such file or directory\n"}
What is expected:
The error seems to be caused when ipv6 is disabled on a host (defined in /boot/grub2/grub.cfg). When ipv6 is disabled, sysctl cannot set properties for values for e.g. ipv6/neigh/default/gc_thresh1.
Environment:
OS: CentOS Linux release 8.2.2004 (Core)
Kernel: 4.18.0-193.28.1.el8_2.x86_64
Kolla-Ansible version: 10.1.0
Fix proposed to the branch master: https:/ /review. opendev. org/c/openstack /kolla- ansible/ +/905831