[DEFAULT]
enabled_inspect_interfaces = redfish,no-inspect,agent
{% if kolla_inspector_enable_discovery | bool %}
# Setting default_inspect_interface is required for the inspection flow to
# continue correctly after the node creation.  See:
# https://docs.openstack.org/ironic/latest/admin/inspection/discovery.html
default_inspect_interface = agent
{% endif %}
{% if kolla_ironic_enabled_hardware_types %}
enabled_hardware_types: {{ kolla_ironic_enabled_hardware_types | join(',') }}
{% endif %}

{# Add configuration of enabled and default dynamic driver interfaces. #}
{% set interfaces=['boot', 'bios', 'console', 'deploy', 'inspect', 'management',
                   'network', 'power', 'raid', 'rescue', 'storage', 'vendor'] %}
{% for interface in interfaces %}
{% if hostvars[inventory_hostname]['kolla_ironic_enabled_' ~ interface ~ '_interfaces'] | default %}
{{ 'enabled_' ~ interface ~ '_interfaces' }} = {{ hostvars[inventory_hostname]['kolla_ironic_enabled_' ~ interface ~ '_interfaces'] | join(',') }}
{% endif %}
{% if hostvars[inventory_hostname]['kolla_ironic_default_' ~ interface ~ '_interface'] | default %}
{{ 'default_' ~ interface ~ '_interface' }} = {{ hostvars[inventory_hostname]['kolla_ironic_default_' ~ interface ~ '_interface'] }}
{% endif %}
{% endfor %}

[agent]
deploy_logs_local_path = /var/log/kolla/ironic/deploy

[redfish]
{% if kolla_ironic_kernel_append_params %}
kernel_append_params = {{ kolla_ironic_kernel_append_params | join(' ') }}
{% endif %}

[neutron]
cleaning_network = {{ kolla_ironic_cleaning_network }}
inspection_network = {{ kolla_ironic_inspection_network }}
provisioning_network = {{ kolla_ironic_provisioning_network }}

[pxe]
{% if kolla_ironic_pxe_append_params %}
kernel_append_params = {{ kolla_ironic_pxe_append_params | join(' ') }}
{% endif %}

{% raw %}
tftp_server = {{ hostvars[inventory_hostname].ansible_facts[api_interface | replace('-', '_')]['ipv4']['address'] }}
{% endraw %}

[auto_discovery]
enabled = {{ kolla_inspector_enable_discovery }}
driver = {{ kolla_inspector_discovery_enroll_node_driver }}

[inspector]
{% if kolla_inspector_enable_discovery | bool %}
# Under unmanaged inspection we understand in-band inspection where the boot
# configuration (iPXE scripts, DHCP options, etc) is not provided by the Bare
# Metal service. In this case, the node is simply set to boot from network and
# powered on. See:
# https://docs.openstack.org/ironic/latest/admin/inspection/managed.html#unmanaged-inspection
require_managed_boot = False
{% endif %}
{% if kolla_inspector_add_ports %}
add_ports = {{ kolla_inspector_add_ports }}
{% endif %}

{% if kolla_inspector_keep_ports %}
keep_ports = {{ kolla_inspector_keep_ports }}
{% endif %}

{% if kolla_inspector_hooks %}
hooks = {{ kolla_inspector_hooks | join(',') }}
{% endif %}

{% if kolla_extra_ironic %}
#######################
# Extra configuration
#######################

{{ kolla_extra_ironic }}
{% endif %}
