Vladislav Belogrudov 1c1d6e20c1 Introduce variable to allow different DVR modes
This feature replaces splitting of compute hosts into inner
and external with a new variable 'neutron_compute_dvr_mode'
that controls whether computes will have full-blown DVR or
internal only (tenant) networking.

Change-Id: I6720ccfcfcec89f9996d4cb5ae60f31eb3113667
Implements: blueprint dvr-mode-property
2018-04-03 19:14:14 +03:00

60 lines
2.2 KiB
YAML

---
- name: Get container facts
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_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
local_action: 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
# When MountFlags is set to shared, a signal bit configured on 20th bit of a number
# We need to check the 20th bit. 2^20 = 1048576. So we are validating against it.
- name: Checking if 'MountFlags' for docker service is set to 'shared'
command: systemctl show docker
register: result
changed_when: false
failed_when: result.stdout.find('MountFlags=1048576') == -1
when:
- (inventory_hostname in groups['neutron-dhcp-agent']
or inventory_hostname in groups['neutron-l3-agent']
or inventory_hostname in groups['neutron-metadata-agent'])
- ansible_os_family == 'RedHat' or ansible_distribution == 'Ubuntu'
- 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 }}"
local_action: 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 for deprecated inner- and external-compute groups
local_action:
module: debug
msg: "WARNING: inner- and external-compute groups are DEPRECATED"
changed_when: false
run_once: True
when:
- (groups['inner-compute'] | default([]) | length > 0
or groups['external-compute'] | default([]) | length > 0)