Skip to content

Commit

Permalink
Add conditionals for IPv6 sysctl settings
Browse files Browse the repository at this point in the history
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
(cherry picked from commit 9301e82)
  • Loading branch information
r-krcek authored and mmalchuk committed Mar 22, 2024
1 parent fceb4fa commit f56396d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ansible/roles/loadbalancer/tasks/config-host.yml
Original file line number Diff line number Diff line change
@@ -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
vars:
should_set: "{{ item.value != 'KOLLA_UNSET' }}"
Expand All @@ -17,6 +23,7 @@
when:
- set_sysctl | bool
- item.value != 'KOLLA_SKIP'
- not ('ipv6' in item.name and ipv6_disabled.stdout | bool)

- name: Load and persist keepalived module
import_role:
Expand Down
6 changes: 6 additions & 0 deletions ansible/roles/neutron/tasks/config-host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
list |
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
become: true
vars:
Expand All @@ -34,3 +39,4 @@
- set_sysctl | bool
- item.value != 'KOLLA_SKIP'
- (neutron_l3_agent.enabled | bool and neutron_l3_agent.host_in_groups | bool)
- not ('ipv6' in item.name and ipv6_disabled.stdout | bool)
8 changes: 8 additions & 0 deletions releasenotes/notes/bug-1906306-640d5085576656f9.yaml
Original file line number Diff line number Diff line change
@@ -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>`__

0 comments on commit f56396d

Please sign in to comment.