diff --git a/releasenotes/notes/ovn_dhcp_metadata_agents-851b42a6923c811f.yaml b/releasenotes/notes/ovn_dhcp_metadata_agents-851b42a6923c811f.yaml new file mode 100644 index 00000000..cbd69321 --- /dev/null +++ b/releasenotes/notes/ovn_dhcp_metadata_agents-851b42a6923c811f.yaml @@ -0,0 +1,10 @@ +--- + +fixes: + - | + Fixed issue where neutron-metadata-agent and neutron-dhcp-agent were + started on network_hosts for OVN scenario along with + neutron-ovn-metadata-agent. These services will be disabled and masked + for existing environments. Manual clean-up of systemd services and + correpsonsive neutron agents is still needed. + New deployments won't have these services deployed from the beginning. diff --git a/tasks/main.yml b/tasks/main.yml index fe7f82de..f9140ea4 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -157,6 +157,30 @@ tags: - neutron-config +# TODO(noonedeadpunk): Remove block for Bobcat release +- name: Disable dhcp and metadata agents for OVN scenario + when: + - neutron_plugin_type == 'ml2.ovn' + - (neutron_services['neutron-metadata-agent']['group'] in group_names) or (neutron_services['neutron-dhcp-agent']['group'] in group_names) + block: + - name: Gather service facts + service_facts: + + - name: Disable services if they present + service: + name: "{{ item['service_name'] }}" + state: stopped + enabled: False + masked: True + when: + - item['group'] in group_names + - item['service_name'] ~ '.service' in ansible_facts.services + notify: + - "Restart neutron services" + with_items: + - "{{ neutron_services['neutron-metadata-agent'] }}" + - "{{ neutron_services['neutron-dhcp-agent'] }}" + - name: Run the systemd service role import_role: name: systemd_service diff --git a/vars/main.yml b/vars/main.yml index 8fb6a464..b88db9dc 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -279,13 +279,13 @@ neutron_l3: "{% if 'router' in neutron_plugin_base or 'neutron.services.l3_route ### DHCP Agent Plugin Configuration ### -neutron_dhcp: "{% if neutron_plugin_type.split('.')[0] == 'ml2' %}True{% else %}False{% endif %}" +neutron_dhcp: "{% if (neutron_plugin_type.split('.')[0] == 'ml2') and (neutron_plugin_type != 'ml2.ovn') %}True{% else %}False{% endif %}" ### ### Metadata Agent Plugin Configuration ### -neutron_metadata: "{% if neutron_plugin_type.split('.')[0] == 'ml2' %}True{% else %}False{% endif %}" +neutron_metadata: "{% if (neutron_plugin_type.split('.')[0] == 'ml2') and (neutron_plugin_type != 'ml2.ovn') %}True{% else %}False{% endif %}" ### ### FWaaS Plugin Configuration