Explicitly set inspector dhcp timeout to 2 minutes

The dnsmasq minimum is 2 minutes, so setting to 29 seconds doesn't
work. Setting it to 2 minutes better reflects reality.
Also using the minutes identifier (m) ensures that dnsmasq doesn't
attempt to parse the timeout as a prefix length if a IPv6 range is
provided.

Change-Id: I9e8585a7e4e5b6a21b05f3c5578c869a2c357b02
This commit is contained in:
Derek Higgins 2017-08-17 10:38:21 +01:00
parent bf5a8ee3fc
commit 71ee4e42be
3 changed files with 10 additions and 10 deletions

View File

@ -142,16 +142,16 @@ describe 'ironic::inspector' do
'content' => /pxelinux/,
)
is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
/dhcp-range=192.168.0.100,192.168.0.120,29/
/dhcp-range=192.168.0.100,192.168.0.120,2m/
)
is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
/dhcp-range=set:subnet1,192.168.1.100,192.168.1.200,255.255.255.0,29/
/dhcp-range=set:subnet1,192.168.1.100,192.168.1.200,255.255.255.0,2m/
)
is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
/dhcp-option=tag:subnet1,option:router,192.168.1.254/
)
is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
/dhcp-range=set:subnet2,192.168.2.100,192.168.2.200,255.255.255.0,29/
/dhcp-range=set:subnet2,192.168.2.100,192.168.2.200,255.255.255.0,2m/
)
is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
/dhcp-option=tag:subnet2,option:router,192.168.2.254/
@ -226,7 +226,7 @@ describe 'ironic::inspector' do
/dhcp-boot=tag:ipxe,http:\/\/192.168.0.1:3816\/inspector.ipxe/
)
is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
/dhcp-range=192.168.0.100,192.168.0.120,29/
/dhcp-range=192.168.0.100,192.168.0.120,2m/
)
end
it 'should contain file /var/www/httpboot/inspector.ipxe' do

View File

@ -3,11 +3,11 @@ interface=<%= @dnsmasq_interface %>
bind-interfaces
<% @dnsmasq_ip_subnets_real.each do |s| -%>
<% if s['tag'] and s['netmask'] -%>
dhcp-range=set:<%= s['tag'] -%>,<%= s['ip_range'] -%>,<%= s['netmask'] -%>,29
dhcp-range=set:<%= s['tag'] -%>,<%= s['ip_range'] -%>,<%= s['netmask'] -%>,2m
<% elsif s['tag'] -%>
dhcp-range=set:<%= s['tag'] -%>,<%= s['ip_range'] -%>,29
dhcp-range=set:<%= s['tag'] -%>,<%= s['ip_range'] -%>,2m
<% else -%>
dhcp-range=<%= s['ip_range'] -%>,29
dhcp-range=<%= s['ip_range'] -%>,2m
<% end -%>
<% if s['gateway'] -%>
<% if s['tag'] -%>

View File

@ -3,11 +3,11 @@ interface=<%= @dnsmasq_interface %>
bind-interfaces
<% @dnsmasq_ip_subnets_real.each do |s| -%>
<% if s['tag'] and s['netmask'] -%>
dhcp-range=set:<%= s['tag'] -%>,<%= s['ip_range'] -%>,<%= s['netmask'] -%>,29
dhcp-range=set:<%= s['tag'] -%>,<%= s['ip_range'] -%>,<%= s['netmask'] -%>,2m
<% elsif s['tag'] -%>
dhcp-range=set:<%= s['tag'] -%>,<%= s['ip_range'] -%>,29
dhcp-range=set:<%= s['tag'] -%>,<%= s['ip_range'] -%>,2m
<% else -%>
dhcp-range=<%= s['ip_range'] -%>,29
dhcp-range=<%= s['ip_range'] -%>,2m
<% end -%>
<% if s['gateway'] -%>
<% if s['tag'] -%>