ovn-migration: Stop ml2/ovs agents before installing OVN resources

TripleO used to uninstall services if the resources were set to None. It
was not intentional and TripleO no longer does that. This patch manually
removes dhcp, l3, metadata and ovs agents from controller and compute
nodes, including its systemd service files.

Closes-Bug: #1878358
Change-Id: I140ae0c476bf9e19b4429ce388ddc7cc3f4cd421
Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
(cherry picked from commit 4d5b9a62b97dfa7245efc92cadda4e4c7d0e406a)
(cherry picked manually from
 Neutron commit 9b0ca47c6dd8b2eca14452c477306d32fc3e2fa7)
changes/00/734900/1
Jakub Libosvar 2 years ago
parent 18fabca005
commit 15f228181c
  1. 8
      migration/tripleo_environment/playbooks/ovn-migration.yml
  2. 1
      migration/tripleo_environment/playbooks/roles/migration/tasks/cleanup-dataplane.yml
  3. 3
      migration/tripleo_environment/playbooks/roles/stop-agents/defaults/main.yml
  4. 21
      migration/tripleo_environment/playbooks/roles/stop-agents/tasks/cleanup.yml
  5. 18
      migration/tripleo_environment/playbooks/roles/stop-agents/tasks/main.yml
  6. 19
      migration/tripleo_environment/playbooks/roles/stop-agents/vars/main.yml

@ -25,6 +25,14 @@
tags:
- setup
- name: Stop ml2/ovs resources
hosts: ovn-controllers
roles:
- stop-agents
tags:
- migration
#
# TripleO / Director is executed to deploy ovn using "br-migration" for the
# dataplane, while br-int is left intact to avoid dataplane disruption.

@ -34,7 +34,6 @@
register: out
changed_when: "'Security groups cleaned' in out.stdout"
- name: Cleanup neutron datapath resources
become: yes
shell: |

@ -0,0 +1,3 @@
---
# defaults file for stop-agents
systemd_service_file_dir: /etc/systemd/system

@ -0,0 +1,21 @@
---
- name: "stop and disable {{ service.name }} services and healthchecks"
systemd:
name: "{{ item }}"
state: stopped
enabled: no
become: yes
loop:
- "{{ service.healthcheck_timer_file }}"
- "{{ service.healthcheck_service_file }}"
- "{{ service.service_file }}"
- name: delete ml2 ovs systemd service files
file:
path: "{{ systemd_service_file_dir }}/{{ item }}"
state: absent
loop:
- "{{ service.service_file }}"
- "{{ service.healthcheck_service_file }}"
- "{{ service.healthcheck_timer_file }}"
become: yes

@ -0,0 +1,18 @@
---
- name: populate service facts
service_facts:
- name: disable ml2 ovs services and healthchecks
include_tasks: cleanup.yml
loop: "{{ ml2_ovs_services }}"
loop_control:
loop_var: service
when: ansible_facts.services[service.service_file] is defined
- name: remove containers
become: yes
shell: |
for agent in $(podman ps -a --format {% raw %}"{{.ID}}"{% endraw %} --filter "name=(neutron_.*_agent|neutron_dhcp)"); do
echo "Cleaning up agent $agent"
podman rm -f $agent
done

@ -0,0 +1,19 @@
---
# vars file for stop-agents
ml2_ovs_services:
- name: dhcp
service_file: tripleo_neutron_dhcp.service
healthcheck_service_file: tripleo_neutron_dhcp_healthcheck.service
healthcheck_timer_file: tripleo_neutron_dhcp_healthcheck.timer
- name: l3
service_file: tripleo_neutron_l3_agent.service
healthcheck_service_file: tripleo_neutron_l3_agent_healthcheck.service
healthcheck_timer_file: tripleo_neutron_l3_agent_healthcheck.timer
- name: metadata
service_file: tripleo_neutron_metadata_agent.service
healthcheck_service_file: tripleo_neutron_metadata_agent_healthcheck.service
healthcheck_timer_file: tripleo_neutron_metadata_agent_healthcheck.timer
- name: ovs
service_file: tripleo_neutron_ovs_agent.service
healthcheck_service_file: tripleo_neutron_ovs_agent_healthcheck.service
healthcheck_timer_file: tripleo_neutron_ovs_agent_healthcheck.timer
Loading…
Cancel
Save