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
This commit is contained in:
Jonathan Rosser 2022-11-01 16:37:27 +00:00
parent b09526d494
commit c9674b656e
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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 }};