From 1d31fdd7858ba8ad8a7f21b0f19e249d8cd6da1a Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Wed, 25 Nov 2015 15:56:33 -0800 Subject: [PATCH] Provide dhcp-range even for static inventory The dnsmasq man page says, regarding the dhcp-host option: Addresses allocated like this are not constrained to be in the range given by the --dhcp-range option, but they must be in the same subnet as some valid dhcp-range. This confusingly-worded datum means that even when dhcp-host is defined, which we do when setting inventory_dhcp=true, we need to specify some kind of dhcp-range. There are a few valid arguments we could supply to the dhcp-range parameter, but the easiest is just to go back to using the existing dhcp_pool_{start,end} parameters, from which dnsmasq will infer a subnet. An alternative to this is to be more strict by using the 'static' keyword for dhcp-range. We would still need to specify the dhcp_pool_start value, which is a required argument for dhcp-range. Change-Id: I4d09c3a716b864c0b0d74cc83a2f0ac7414b386c --- .../roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 | 2 -- 1 file changed, 2 deletions(-) diff --git a/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 b/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 index 54bb2ff61..62e52386f 100644 --- a/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 +++ b/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 @@ -154,13 +154,11 @@ dhcp-hostsfile=/etc/dnsmasq.d/bifrost.dhcp-hosts.d # a lease time. If you have more than one network, you will need to # repeat this for each network on which you want to supply DHCP # service. -{% if not inventory_dhcp %} {% if testing %} dhcp-range=192.168.122.2,192.168.122.254,12h {% else %} dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},{{dhcp_lease_time}} {% endif %} -{% endif %} # This is an example of a DHCP range where the netmask is given. This # is needed for networks we reach the dnsmasq DHCP server via a relay