Add conditionals for IPv6 sysctl settings

This way the playbooks won't try to set ipv6 systemctl options
unless ipv6 is available on the system.

Closes-bug: #1906306
Change-Id: Icccfc1c509179c3cfd59650b7917a637f9af9646
This commit is contained in:
Roman Krček 2024-01-15 15:19:42 +01:00
parent 8c760d38a0
commit 9301e82d7b
3 changed files with 21 additions and 0 deletions

View File

@ -1,4 +1,10 @@
--- ---
- name: Check IPv6 support
command: /usr/sbin/sysctl -n net.ipv6.conf.all.disable_ipv6
register: ipv6_disabled
changed_when: false
- name: Setting sysctl values - name: Setting sysctl values
vars: vars:
should_set: "{{ item.value != 'KOLLA_UNSET' }}" should_set: "{{ item.value != 'KOLLA_UNSET' }}"
@ -17,6 +23,7 @@
when: when:
- set_sysctl | bool - set_sysctl | bool
- item.value != 'KOLLA_SKIP' - item.value != 'KOLLA_SKIP'
- not ('ipv6' in item.name and ipv6_disabled.stdout | bool)
- name: Load and persist keepalived module - name: Load and persist keepalived module
import_role: import_role:

View File

@ -12,6 +12,11 @@
list | list |
length > 0 length > 0
- name: Check IPv6 support
command: /usr/sbin/sysctl -n net.ipv6.conf.all.disable_ipv6
register: ipv6_disabled
changed_when: false
- name: Setting sysctl values - name: Setting sysctl values
become: true become: true
vars: vars:
@ -34,3 +39,4 @@
- set_sysctl | bool - set_sysctl | bool
- item.value != 'KOLLA_SKIP' - item.value != 'KOLLA_SKIP'
- (neutron_l3_agent.enabled | bool and neutron_l3_agent.host_in_groups | bool) - (neutron_l3_agent.enabled | bool and neutron_l3_agent.host_in_groups | bool)
- not ('ipv6' in item.name and ipv6_disabled.stdout | bool)

View File

@ -0,0 +1,8 @@
---
fixes:
- |
Add conditionals for IPv6 sysctl settings
that have IPV6 disabled in kernel.
Changing sysctl settings related to IPv6 on those
systems lead to errors.
`LP#1906306 <https://launchpad.net/bugs/1906306>`__