Browse Source

Merge "ovn-migration: Stop ml2/ovs agents before installing OVN resources" into stable/ussuri

changes/48/735948/1
Zuul 3 weeks ago
committed by Gerrit Code Review
parent
commit
ca71998c3a
5 changed files with 69 additions and 0 deletions
  1. +8
    -0
      tools/ovn_migration/tripleo_environment/playbooks/ovn-migration.yml
  2. +3
    -0
      tools/ovn_migration/tripleo_environment/playbooks/roles/stop-agents/defaults/main.yml
  3. +21
    -0
      tools/ovn_migration/tripleo_environment/playbooks/roles/stop-agents/tasks/cleanup.yml
  4. +18
    -0
      tools/ovn_migration/tripleo_environment/playbooks/roles/stop-agents/tasks/main.yml
  5. +19
    -0
      tools/ovn_migration/tripleo_environment/playbooks/roles/stop-agents/vars/main.yml

+ 8
- 0
tools/ovn_migration/tripleo_environment/playbooks/ovn-migration.yml View File

@@ -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.


+ 3
- 0
tools/ovn_migration/tripleo_environment/playbooks/roles/stop-agents/defaults/main.yml View File

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

+ 21
- 0
tools/ovn_migration/tripleo_environment/playbooks/roles/stop-agents/tasks/cleanup.yml View File

@@ -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

+ 18
- 0
tools/ovn_migration/tripleo_environment/playbooks/roles/stop-agents/tasks/main.yml View File

@@ -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

+ 19
- 0
tools/ovn_migration/tripleo_environment/playbooks/roles/stop-agents/vars/main.yml View File

@@ -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