2016-11-03 14:48:58 +08:00
|
|
|
---
|
2016-12-29 08:00:51 +08:00
|
|
|
- name: Get container facts
|
|
|
|
kolla_container_facts:
|
|
|
|
name:
|
|
|
|
- neutron_server
|
|
|
|
register: container_facts
|
|
|
|
|
|
|
|
- name: Checking free port for Neutron Server
|
|
|
|
wait_for:
|
2017-04-18 09:10:44 +02:00
|
|
|
host: "{{ api_interface_address }}"
|
2016-12-29 08:00:51 +08:00
|
|
|
port: "{{ neutron_server_port }}"
|
|
|
|
connect_timeout: 1
|
2017-05-04 08:52:57 +08:00
|
|
|
timeout: 1
|
2016-12-29 08:00:51 +08:00
|
|
|
state: stopped
|
|
|
|
when:
|
|
|
|
- container_facts['neutron_server'] is not defined
|
|
|
|
- inventory_hostname in groups['neutron-server']
|
2017-03-06 16:12:00 +08:00
|
|
|
|
|
|
|
- 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
|
|
|
|
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'])
|
2017-03-22 22:23:08 +01:00
|
|
|
- ansible_os_family == 'RedHat' or ansible_distribution == 'Ubuntu'
|