kolla-ansible/ansible/roles/neutron/tasks/precheck.yml
Rafal Lewandowski d3d67dc02c Add ML2/OVN and ML2/OVS setting checks for neutron
It will check the setting of neutron_plugin_agent,
if it is set to "ovn" or "openvswitch", and run
container and volume checks to make sure the other
agent was not already deployed.

Change-Id: Ie00572f3ff9d3500abd5519bd472e2134c318886
2023-09-26 21:24:12 +02:00

58 lines
1.7 KiB
YAML

---
- import_role:
name: service-precheck
vars:
service_precheck_services: "{{ neutron_services }}"
service_name: "{{ project_name }}"
- name: Get container facts
become: true
kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name:
- neutron_server
check_mode: false
register: container_facts
- name: Checking free port for Neutron Server
wait_for:
host: "{{ api_interface_address }}"
port: "{{ neutron_server_listen_port }}"
connect_timeout: 1
timeout: 1
state: stopped
when:
- container_facts['neutron_server'] is not defined
- inventory_hostname in groups['neutron-server']
- name: Checking number of network agents
assert:
that:
- groups['neutron-dhcp-agent'] | length > 1
- groups['neutron-l3-agent'] | length > 1
fail_msg: "Number of network agents are less than two when enabling agent ha"
changed_when: false
run_once: True
when:
- enable_neutron_agent_ha | bool
- name: Checking tenant network types
assert:
that: item in type_drivers
fail_msg: "Tenant network type '{{ item }}' is not in type drivers [{{ neutron_type_drivers }}]"
with_items: "{{ tenant_network_types }}"
vars:
type_drivers: "{{ neutron_type_drivers.replace(' ', '').split(',') | reject('equalto', '') | list }}"
tenant_network_types: "{{ neutron_tenant_network_types.replace(' ', '').split(',') | reject('equalto', '') | list }}"
run_once: true
- name: Checking whether Ironic enabled
assert:
that: enable_ironic | bool
fail_msg: "Ironic must be enabled when using networking-baremetal/ironic-neutron-agent"
run_once: True
when:
- enable_ironic_neutron_agent | bool
- import_tasks: neutron_plugin_agent_check.yml