2016-11-03 14:48:58 +08:00
|
|
|
---
|
2016-12-29 09:33:45 +08:00
|
|
|
- name: Get container facts
|
|
|
|
kolla_container_facts:
|
|
|
|
name:
|
|
|
|
- nova_api
|
|
|
|
- nova_novncproxy
|
2016-08-22 22:21:25 +02:00
|
|
|
- nova_serialproxy
|
2016-12-29 09:33:45 +08:00
|
|
|
- nova_spicehtml5proxy
|
2017-03-19 16:55:58 +08:00
|
|
|
- nova_ssh
|
2017-03-06 16:12:00 +08:00
|
|
|
- nova_libvirt
|
2017-02-24 11:13:04 +08:00
|
|
|
- placement_api
|
2016-12-29 09:33:45 +08:00
|
|
|
register: container_facts
|
|
|
|
|
2017-04-26 15:57:05 +02:00
|
|
|
- name: Checking available compute nodes in inventory
|
|
|
|
fail:
|
|
|
|
msg: "At least 1 compute node required in inventory"
|
|
|
|
when: groups['compute'] | length < 1
|
|
|
|
|
2016-12-29 09:33:45 +08:00
|
|
|
- name: Checking free port for Nova API
|
2016-12-06 17:12:20 +08:00
|
|
|
vars:
|
|
|
|
nova_api: "{{ nova_services['nova-api'] }}"
|
2016-12-29 09:33:45 +08:00
|
|
|
wait_for:
|
2017-04-18 09:10:44 +02:00
|
|
|
host: "{{ api_interface_address }}"
|
2016-12-29 09:33:45 +08:00
|
|
|
port: "{{ nova_api_port }}"
|
|
|
|
connect_timeout: 1
|
2017-05-04 08:52:57 +08:00
|
|
|
timeout: 1
|
2016-12-29 09:33:45 +08:00
|
|
|
state: stopped
|
|
|
|
when:
|
|
|
|
- container_facts['nova_api'] is not defined
|
2016-12-06 17:12:20 +08:00
|
|
|
- inventory_hostname in groups[nova_api.group]
|
|
|
|
- nova_api.enabled | bool
|
2016-12-29 09:33:45 +08:00
|
|
|
|
|
|
|
- name: Checking free port for Nova Metadata
|
2016-12-06 17:12:20 +08:00
|
|
|
vars:
|
|
|
|
nova_api: "{{ nova_services['nova-api'] }}"
|
2016-12-29 09:33:45 +08:00
|
|
|
wait_for:
|
2017-04-18 09:10:44 +02:00
|
|
|
host: "{{ api_interface_address }}"
|
2016-12-29 09:33:45 +08:00
|
|
|
port: "{{ nova_metadata_port }}"
|
|
|
|
connect_timeout: 1
|
2017-05-04 08:52:57 +08:00
|
|
|
timeout: 1
|
2016-12-29 09:33:45 +08:00
|
|
|
state: stopped
|
|
|
|
when:
|
|
|
|
- container_facts['nova_api'] is not defined
|
2016-12-06 17:12:20 +08:00
|
|
|
- inventory_hostname in groups[nova_api.group]
|
|
|
|
- nova_api.enabled | bool
|
2016-12-29 09:33:45 +08:00
|
|
|
|
|
|
|
- name: Checking free port for Nova NoVNC Proxy
|
2016-12-06 17:12:20 +08:00
|
|
|
vars:
|
|
|
|
nova_novncproxy: "{{ nova_services['nova-novncproxy'] }}"
|
2016-12-29 09:33:45 +08:00
|
|
|
wait_for:
|
2017-04-18 09:10:44 +02:00
|
|
|
host: "{{ api_interface_address }}"
|
2016-12-29 09:33:45 +08:00
|
|
|
port: "{{ nova_novncproxy_port }}"
|
|
|
|
connect_timeout: 1
|
2017-05-04 08:52:57 +08:00
|
|
|
timeout: 1
|
2016-12-29 09:33:45 +08:00
|
|
|
state: stopped
|
|
|
|
when:
|
|
|
|
- container_facts['nova_novncproxy'] is not defined
|
2016-12-06 17:12:20 +08:00
|
|
|
- nova_novncproxy.enabled | bool
|
|
|
|
- inventory_hostname in groups[nova_novncproxy.group]
|
2016-12-29 09:33:45 +08:00
|
|
|
|
2016-08-22 22:21:25 +02:00
|
|
|
- name: Checking free port for Nova Serial Proxy
|
2016-12-06 17:12:20 +08:00
|
|
|
vars:
|
|
|
|
nova_serialproxy: "{{ nova_services['nova-serialproxy'] }}"
|
2016-08-22 22:21:25 +02:00
|
|
|
wait_for:
|
2017-04-18 09:10:44 +02:00
|
|
|
host: "{{ api_interface_address }}"
|
2016-08-22 22:21:25 +02:00
|
|
|
port: "{{ nova_serialproxy_port }}"
|
|
|
|
connect_timeout: 1
|
2017-05-04 08:52:57 +08:00
|
|
|
timeout: 1
|
2016-08-22 22:21:25 +02:00
|
|
|
state: stopped
|
|
|
|
when:
|
|
|
|
- container_facts['nova_serialproxy'] is not defined
|
2016-12-06 17:12:20 +08:00
|
|
|
- nova_serialproxy.enabled | bool
|
|
|
|
- inventory_hostname in groups[nova_serialproxy.group]
|
2016-08-22 22:21:25 +02:00
|
|
|
|
2016-12-29 09:33:45 +08:00
|
|
|
- name: Checking free port for Nova Spice HTML5 Proxy
|
2016-12-06 17:12:20 +08:00
|
|
|
vars:
|
|
|
|
nova_spicehtml5proxy: "{{ nova_services['nova-spicehtml5proxy'] }}"
|
2016-12-29 09:33:45 +08:00
|
|
|
wait_for:
|
2017-04-18 09:10:44 +02:00
|
|
|
host: "{{ api_interface_address }}"
|
2016-12-29 09:33:45 +08:00
|
|
|
port: "{{ nova_spicehtml5proxy_port }}"
|
|
|
|
connect_timeout: 1
|
2017-05-04 08:52:57 +08:00
|
|
|
timeout: 1
|
2016-12-29 09:33:45 +08:00
|
|
|
state: stopped
|
|
|
|
when:
|
|
|
|
- container_facts['nova_spicehtml5proxy'] is not defined
|
2016-12-06 17:12:20 +08:00
|
|
|
- nova_spicehtml5proxy.enabled | bool
|
|
|
|
- inventory_hostname in groups[nova_spicehtml5proxy.group]
|
2017-02-24 11:13:04 +08:00
|
|
|
|
2017-03-19 16:55:58 +08:00
|
|
|
- name: Checking free port for Nova SSH
|
|
|
|
vars:
|
|
|
|
nova_ssh: "{{ nova_services['nova-ssh'] }}"
|
|
|
|
wait_for:
|
2017-04-18 09:10:44 +02:00
|
|
|
host: "{{ api_interface_address }}"
|
2017-03-19 16:55:58 +08:00
|
|
|
port: "{{ nova_ssh_port }}"
|
|
|
|
connect_timeout: 1
|
2017-05-04 08:52:57 +08:00
|
|
|
timeout: 1
|
2017-03-19 16:55:58 +08:00
|
|
|
state: stopped
|
|
|
|
when:
|
|
|
|
- container_facts['nova_ssh'] is not defined
|
|
|
|
- nova_ssh.enabled | bool
|
|
|
|
- inventory_hostname in groups[nova_ssh.group]
|
|
|
|
|
2017-02-24 11:13:04 +08:00
|
|
|
- name: Checking free port for Nova Placement API
|
|
|
|
vars:
|
|
|
|
placement_api: "{{ nova_services['placement-api'] }}"
|
|
|
|
wait_for:
|
2017-04-18 09:10:44 +02:00
|
|
|
host: "{{ api_interface_address }}"
|
2017-02-24 11:13:04 +08:00
|
|
|
port: "{{ placement_api_port }}"
|
|
|
|
connect_timeout: 1
|
2017-05-04 08:52:57 +08:00
|
|
|
timeout: 1
|
2017-02-24 11:13:04 +08:00
|
|
|
state: stopped
|
|
|
|
when:
|
|
|
|
- container_facts['placement_api'] is not defined
|
|
|
|
- inventory_hostname in groups[placement_api.group]
|
|
|
|
- placement_api.enabled | bool
|
2017-03-06 16:12:00 +08:00
|
|
|
|
|
|
|
- name: Checking that libvirt is not running
|
|
|
|
vars:
|
|
|
|
nova_libvirt: "{{ nova_services['nova-libvirt'] }}"
|
|
|
|
stat: path=/var/run/libvirt/libvirt-sock
|
|
|
|
register: result
|
|
|
|
failed_when: result.stat.exists
|
|
|
|
when:
|
|
|
|
- container_facts['nova_libvirt'] is not defined
|
|
|
|
- inventory_hostname in groups[nova_libvirt.group]
|