Skip to content

Commit

Permalink
Disable dhcp-agent and metadata-agent for OVN
Browse files Browse the repository at this point in the history
OVN doesn't need the neutron-metadata-agent and
neutron-dhcp-agent service.

Change-Id: I58e94199a32ad300b3f70861dc7804f34518c8c2
  • Loading branch information
mgariepy authored and noonedeadpunk committed Jan 18, 2023
1 parent 0d6ca7f commit c5e00f9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
10 changes: 10 additions & 0 deletions releasenotes/notes/ovn_dhcp_metadata_agents-851b42a6923c811f.yaml
Original file line number Diff line number Diff line change
@@ -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.
24 changes: 24 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c5e00f9

Please sign in to comment.