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 4d5b9a62b9
)
This commit is contained in:
parent
fe5d772c9f
commit
9b0ca47c6d
|
@ -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.
|
||||
|
|
|
@ -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…
Reference in New Issue