49fb55f182
We assume that all groups are present in the inventory, and quite obtuse errors can result if any are not. This change adds a precheck that checks for the presence of all expected groups in the inventory for each service. It also introduces a common service-precheck role that we can use for other common prechecks. Change-Id: Ia0af1e7df4fff7f07cd6530e5b017db8fba530b3 Partially-Implements: blueprint improve-prechecks
55 lines
1.6 KiB
YAML
55 lines
1.6 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:
|
|
name:
|
|
- neutron_server
|
|
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
|
|
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
|
|
- groups['neutron-dhcp-agent'] | length < 2
|
|
or groups['neutron-l3-agent'] | length < 2
|
|
|
|
- name: Checking 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 }}"
|
|
fail:
|
|
msg: "Tenant network type '{{ item }}' is not in type drivers [{{ neutron_type_drivers }}]"
|
|
changed_when: false
|
|
when: item not in type_drivers
|
|
run_once: true
|
|
with_items: "{{ tenant_network_types }}"
|
|
|
|
- name: Checking whether Ironic enabled
|
|
fail:
|
|
msg: "Ironic must be enabled when using networking-baremetal/ironic-neutron-agent"
|
|
changed_when: false
|
|
run_once: True
|
|
when:
|
|
- enable_ironic_neutron_agent | bool
|
|
- not (enable_ironic | bool)
|