kolla-ansible/ansible/roles/neutron/tasks/neutron_plugin_agent_check.yml
Ivan Halomi 32cdbd23d5 Merge of container_facts modules
Merge container_facts and container_volume_facts
into a single module for retrieving all information
about containers and volumes.

Change-Id: I5d321b8326edd7f3b7a11dbdc821e534f457f9d7
Signed-off-by: Ivan Halomi <ivan.halomi@tietoevry.com>
Signed-off-by: Roman Krček <roman.krcek@tietoevry.com>
2025-03-19 14:06:06 +00:00

38 lines
1.3 KiB
YAML

---
- name: Get container facts
become: true
kolla_container_facts:
action: get_containers
container_engine: "{{ kolla_container_engine }}"
name:
- neutron_openvswitch_agent
- ovn_controller
check_mode: false
register: container_facts
- name: Get container volume facts
become: true
kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
action: get_volumes
name:
- ovn_nb_db
- ovn_sb_db
check_mode: false
register: container_volume_facts
- name: Check for ML2/OVN presence
assert:
that: neutron_plugin_agent == 'ovn'
fail_msg: "ML2/OVN agent detected, neutron_plugin_agent is not set to 'ovn', Kolla-Ansible does not support this migration operation."
when: (container_facts.containers['ovn_controller'] is defined) or (container_volume_facts['ovn_nb_db'] is defined) or (container_volume_facts['ovn_sb_db'] is defined)
- name: Check for ML2/OVS presence
assert:
that:
- neutron_plugin_agent == 'openvswitch'
- container_volume_facts.volumes['ovn_nb_db'] is not defined
- container_volume_facts.volumes['ovn_sb_db'] is not defined
fail_msg: "ML2/OVS agent detected, neutron_plugin_agent is not set to 'openvswitch', Kolla-Ansible does not support this migration operation."
when: container_facts.containers['neutron_openvswitch_agent'] is defined