4ce47e2250
Refactor that prepares kolla_container_facts module for introducing more actions that will be moved from kolla_container module and kolla_container_volume_facts. This change is based on a discussion about adding a new action to kolla_container module that retrieves all names of the running containers. It was agreed that kolla-ansible should follow Ansible's direction of splitting modules between action modules and facts modules. Because of this, kolla_container_facts needs to be able to handle different requests for data about containers or volumes. Change-Id: Ieaec8f64922e4e5a2199db2d6983518b124cb4aa Signed-off-by: Ivan Halomi <ivan.halomi@tietoevry.com>
72 lines
2.2 KiB
YAML
72 lines
2.2 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:
|
|
action: get_containers
|
|
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
|
|
|
|
- name: Checking if neutron's dns domain has proper value
|
|
assert:
|
|
that:
|
|
- neutron_dns_domain != None
|
|
- neutron_dns_domain | length != 0
|
|
- neutron_dns_domain[-1] == '.'
|
|
- neutron_dns_domain != "openstacklocal"
|
|
fail_msg: "The neutron_dns_domain value has to be non-empty and must end with a period '.'"
|
|
changed_when: false
|
|
run_once: True
|
|
when:
|
|
- neutron_dns_integration | bool
|
|
|
|
- import_tasks: neutron_plugin_agent_check.yml
|