diff --git a/defaults/main.yml b/defaults/main.yml index 69dd410f..abf187ff 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -383,7 +383,9 @@ ironic_inspector_dhcp_address: "{{ ironic_bmaas_address }}" ironic_inspector_dhcp_pool_range: 192.168.0.51 192.168.0.150 ironic_inspector_dhcp_subnet: 192.168.0.0/22 ironic_inspector_dhcp_subnet_mask: 255.255.252.0 +ironic_insepctor_dhcp_enable_gateway: True ironic_inspector_dhcp_gateway: 192.168.0.1 +ironic_inspector_dhcp_enable_nameservers: True ironic_inspector_dhcp_nameservers: 192.168.0.1 ironic_inspector_dhcp_lease_time: 600 diff --git a/templates/dhcpd.conf.j2 b/templates/dhcpd.conf.j2 index ed9de9bc..d76af416 100644 --- a/templates/dhcpd.conf.j2 +++ b/templates/dhcpd.conf.j2 @@ -11,8 +11,12 @@ 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 }};