kolla-ansible/ansible/roles/ironic/tasks/precheck.yml
Jim Rollenhagen d1d1837c25 Allow ironic services to use independent hostnames
This allows ironic service endpoints to use custom hostnames, and adds the
following variables:

* ironic_internal_fqdn
* ironic_external_fqdn
* ironic_inspector_internal_fqdn
* ironic_inspector_external_fqdn

These default to the old values of kolla_internal_fqdn or
kolla_external_fqdn.

This also adds ironic_api_listen_port and ironic_inspector_listen_port
options, which default to ironic_api_port and ironic_inspector_port for
backward compatibility.

These options allow the user to differentiate between the port the
service listens on, and the port the service is reachable on. This is
useful for external load balancers which live on the same host as the
service itself.

Change-Id: I45b175e85866b4cfecad8451b202a5a27f888a84
Implements: blueprint service-hostnames
2019-03-06 15:08:28 -05:00

67 lines
1.9 KiB
YAML

---
- name: Get container facts
kolla_container_facts:
name:
- ironic_api
- ironic_inspector
- ironic_ipxe
register: container_facts
- name: Checking free port for Ironic API
wait_for:
host: "{{ api_interface_address }}"
port: "{{ ironic_api_listen_port }}"
connect_timeout: 1
timeout: 1
state: stopped
when:
- container_facts['ironic_api'] is not defined
- inventory_hostname in groups['ironic-api']
- name: Checking free port for Ironic Inspector
wait_for:
host: "{{ api_interface_address }}"
port: "{{ ironic_inspector_listen_port }}"
connect_timeout: 1
timeout: 1
state: stopped
when:
- container_facts['ironic_inspector'] is not defined
- inventory_hostname in groups['ironic-inspector']
- 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']
- name: Checking ironic-agent files exist for Ironic Inspector
local_action: stat path="{{ node_custom_config }}/ironic/{{ item }}"
run_once: True
register: result
failed_when: not result.stat.exists
when:
# Only required when Ironic inspector is in use.
- groups['ironic-inspector'] | length > 0
- (not enable_ironic_ipxe | bool and inventory_hostname in groups['ironic-pxe']) or
(enable_ironic_ipxe | bool and inventory_hostname in groups['ironic-ipxe'])
- not enable_ironic_pxe_uefi | bool
with_items:
- "ironic-agent.kernel"
- "ironic-agent.initramfs"
- 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