openstack-ansible-os_ironic/templates/dhcpd.conf.j2
Jonathan Rosser c9674b656e Allow ironic bmaas network gateway and dns servers to be undefined
For a simple unrouted network these do not exist, but the role
currently forces bogus values to be given for the dhcpd template.

Allow the values to be unset to reduce confusion.

Change-Id: I609a05c50d1de5668f2b092e3a3ef1015e944fe6
2022-11-25 14:38:54 +00:00

38 lines
1.3 KiB
Django/Jinja

ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
option pxe-system-type code 93 = unsigned integer 16;
set pxetype = option pxe-system-type;
subnet {{ ironic_inspector_dhcp_subnet }} netmask {{ ironic_inspector_dhcp_subnet_mask }} {
{% if ironic_inspector_enable_dhcp_gateway | bool %}
option routers {{ ironic_inspector_dhcp_gateway }};
{% endif %}
{% if ironic_inspector_enable_dhcp_nameservers | bool %}
option domain-name-servers {{ ironic_inspector_dhcp_nameservers}};
{% endif %}
option subnet-mask {{ ironic_inspector_dhcp_subnet_mask }};
range dynamic-bootp {{ ironic_inspector_dhcp_pool_range }};
default-lease-time {{ ironic_inspector_dhcp_lease_time }};
max-lease-time 43200;
next-server {{ ironic_inspector_dhcp_interface }};
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
if pxetype=6 or pxetype=7 {
filename "syslinux.efi";
} else {
{% if ironic_inspector_boot_mode == "http" %}
filename "lpxelinux.0";
{% else %}
filename "pxelinux.0";
{% endif %}
}
}
}