2016-11-03 14:48:58 +08:00
|
|
|
---
|
2016-12-28 23:00:37 +08:00
|
|
|
- name: Get container facts
|
2019-04-09 11:59:02 +00:00
|
|
|
become: true
|
2016-12-28 23:00:37 +08:00
|
|
|
kolla_container_facts:
|
|
|
|
name:
|
|
|
|
- ironic_api
|
2017-02-26 14:38:07 +08:00
|
|
|
- ironic_inspector
|
2018-04-18 17:46:38 +01:00
|
|
|
- ironic_ipxe
|
2016-12-28 23:00:37 +08:00
|
|
|
register: container_facts
|
|
|
|
|
2017-03-01 09:36:17 +08:00
|
|
|
- name: Checking free port for Ironic API
|
2016-12-28 23:00:37 +08:00
|
|
|
wait_for:
|
2017-04-18 09:10:44 +02:00
|
|
|
host: "{{ api_interface_address }}"
|
2018-12-27 15:31:04 -05:00
|
|
|
port: "{{ ironic_api_listen_port }}"
|
2016-12-28 23:00:37 +08:00
|
|
|
connect_timeout: 1
|
2017-05-04 08:52:57 +08:00
|
|
|
timeout: 1
|
2016-12-28 23:00:37 +08:00
|
|
|
state: stopped
|
|
|
|
when:
|
|
|
|
- container_facts['ironic_api'] is not defined
|
|
|
|
- inventory_hostname in groups['ironic-api']
|
2017-02-24 10:31:35 +08:00
|
|
|
|
2017-02-26 14:38:07 +08:00
|
|
|
- name: Checking free port for Ironic Inspector
|
|
|
|
wait_for:
|
2017-04-18 09:10:44 +02:00
|
|
|
host: "{{ api_interface_address }}"
|
2018-12-27 15:31:04 -05:00
|
|
|
port: "{{ ironic_inspector_listen_port }}"
|
2017-02-26 14:38:07 +08:00
|
|
|
connect_timeout: 1
|
2017-05-04 08:52:57 +08:00
|
|
|
timeout: 1
|
2017-02-26 14:38:07 +08:00
|
|
|
state: stopped
|
|
|
|
when:
|
|
|
|
- container_facts['ironic_inspector'] is not defined
|
|
|
|
- inventory_hostname in groups['ironic-inspector']
|
|
|
|
|
2018-04-18 17:46:38 +01:00
|
|
|
- name: Checking free port for Ironic iPXE
|
|
|
|
wait_for:
|
|
|
|
host: "{{ api_interface_address }}"
|
|
|
|
port: "{{ ironic_ipxe_port }}"
|
|
|
|
connect_timeout: 1
|
|
|
|
timeout: 1
|
|
|
|
state: stopped
|
|
|
|
when:
|
|
|
|
- enable_ironic_ipxe | bool
|
|
|
|
- container_facts['ironic_ipxe'] is not defined
|
|
|
|
- inventory_hostname in groups['ironic-ipxe']
|
|
|
|
|
2018-01-12 15:47:17 +00:00
|
|
|
- name: Checking ironic-agent files exist for Ironic Inspector
|
2017-02-24 10:31:35 +08:00
|
|
|
local_action: stat path="{{ node_custom_config }}/ironic/{{ item }}"
|
2017-07-04 18:22:55 +02:00
|
|
|
run_once: True
|
2017-02-24 10:31:35 +08:00
|
|
|
register: result
|
|
|
|
failed_when: not result.stat.exists
|
|
|
|
when:
|
2017-02-21 19:22:28 +00:00
|
|
|
# Only required when Ironic inspector is in use.
|
|
|
|
- groups['ironic-inspector'] | length > 0
|
2018-04-18 17:46:38 +01:00
|
|
|
- (not enable_ironic_ipxe | bool and inventory_hostname in groups['ironic-pxe']) or
|
|
|
|
(enable_ironic_ipxe | bool and inventory_hostname in groups['ironic-ipxe'])
|
2018-01-12 15:47:17 +00:00
|
|
|
- not enable_ironic_pxe_uefi | bool
|
2017-02-24 10:31:35 +08:00
|
|
|
with_items:
|
|
|
|
- "ironic-agent.kernel"
|
|
|
|
- "ironic-agent.initramfs"
|
2017-10-11 10:36:36 +08:00
|
|
|
|
|
|
|
- name: Ensure dnsmasq_dhcp_range configured for Ironic Dnsmasq
|
|
|
|
fail:
|
|
|
|
msg: >
|
|
|
|
ironic_dnsmasq_dhcp_range must be set when enable ironic
|
|
|
|
connection: local
|
|
|
|
run_once: True
|
|
|
|
when:
|
|
|
|
- ironic_dnsmasq_dhcp_range is none
|