diff --git a/ansible/roles/ironic/defaults/main.yml b/ansible/roles/ironic/defaults/main.yml index 64a76e13c4..e6f675a025 100644 --- a/ansible/roles/ironic/defaults/main.yml +++ b/ansible/roles/ironic/defaults/main.yml @@ -139,6 +139,7 @@ openstack_ironic_inspector_auth: "{{ openstack_auth }}" ironic_dnsmasq_interface: "{{ api_interface }}" ironic_dnsmasq_dhcp_range: +ironic_dnsmasq_default_gateway: ironic_dnsmasq_boot_file: "{% if enable_ironic_ipxe | bool %}undionly.kpxe{% else %}pxelinux.0{% endif %}" ironic_cleaning_network: ironic_console_serial_speed: "115200n8" diff --git a/ansible/roles/ironic/templates/ironic-dnsmasq.conf.j2 b/ansible/roles/ironic/templates/ironic-dnsmasq.conf.j2 index 1e21eb8b13..cc97dfaaa0 100644 --- a/ansible/roles/ironic/templates/ironic-dnsmasq.conf.j2 +++ b/ansible/roles/ironic/templates/ironic-dnsmasq.conf.j2 @@ -1,6 +1,9 @@ port=0 interface={{ api_interface }} dhcp-range={{ ironic_dnsmasq_dhcp_range }} +{% if ironic_dnsmasq_default_gateway is not none %} +dhcp-option=3,{{ ironic_dnsmasq_default_gateway }} +{% endif %} dhcp-option=option:tftp-server,{{ api_interface_address }} dhcp-option=option:server-ip-address,{{ api_interface_address }} bind-interfaces diff --git a/doc/source/reference/ironic-guide.rst b/doc/source/reference/ironic-guide.rst index 4eae760b08..964d0f317e 100644 --- a/doc/source/reference/ironic-guide.rst +++ b/doc/source/reference/ironic-guide.rst @@ -30,6 +30,15 @@ network: .. end +In the same file, optionally a default gateway to be used for the Ironic +Inspector inspection network: + +.. code-block:: yaml + + ironic_dnsmasq_default_gateway: 192.168.5.1 + +.. end + In the same file, specify the PXE bootloader file for Ironic Inspector. The file is relative to the ``/tftpboot`` directory. The default is ``pxelinux.0``, and should be correct for x86 systems. Other platforms may require a different diff --git a/releasenotes/notes/ironic-dnsmasq-gateway-5a887a0a2f946bd5.yaml b/releasenotes/notes/ironic-dnsmasq-gateway-5a887a0a2f946bd5.yaml new file mode 100644 index 0000000000..3461ce792e --- /dev/null +++ b/releasenotes/notes/ironic-dnsmasq-gateway-5a887a0a2f946bd5.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Adds support for configuring a default gateway to be used in the Ironic + Inspector inspection network. This is configured via the + ``ironic_dnsmasq_default_gateway`` variable, and is not set by default.