Workaround ovs bug that resets hostname with add command

After RDO bumped OVS version to 3.1 from 2.17 CentOS/Rocky fails
tempest testing due to systemd unit calling adding hostname [1]
while ovs-vsctl add in 3.1 actually behaves exactly as `set` which
simply resets defined hostname on each service restart. To avoid that
we're adding `--no-record-hostname` flag that will prevent such
behaviour.

[1] https://github.com/openvswitch/ovs/blob/branch-3.1/utilities/ovs-ctl.in#L51

Change-Id: I8bee1850e3a120f7b76f586909e6d74361696e32
Related-Bug: #2013189
(cherry picked from commit f1a8c358531bdf86d8aeda725bc0b1c347d325c1)
This commit is contained in:
Dmitriy Rabotyagov 2023-03-29 16:24:34 +02:00 committed by Dmitriy Rabotyagov
parent 16c7d9d943
commit 9bd23d7d39

View File

@ -49,6 +49,20 @@
- neutron_services['neutron-ovn-controller']['group'] in group_names
- neutron_ovn_ssl
# NOTE(noonedeapdunk): ovs 3.1 installed by rdo now has a bug, where
# `ovs-vsctl add` acts exactly as `set` and resets hostname
# so we fully disable functionality of managing hostnames
# Ubuntu in it's place don't run this vulnerable version and
# passes --no-record-hostname in systemd unit file already
- name: Disable seetting ovs hostname for RHEL
lineinfile:
path: /etc/sysconfig/openvswitch
line: OPTIONS="--no-record-hostname"
search_string: 'OPTIONS='
when:
- ansible_facts['pkg_mgr'] == 'dnf'
- neutron_services['neutron-ovn-controller']['group'] in group_names
- name: Ensure ovn-northd service is started and enabled
systemd:
name: "{{ neutron_ovn_northd_service_name }}"