From 71ee4e42be06d361857433d038715261b52ae04d Mon Sep 17 00:00:00 2001 From: Derek Higgins Date: Thu, 17 Aug 2017 10:38:21 +0100 Subject: [PATCH] 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 --- spec/classes/ironic_inspector_spec.rb | 8 ++++---- templates/inspector_dnsmasq_http.erb | 6 +++--- templates/inspector_dnsmasq_tftp.erb | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/classes/ironic_inspector_spec.rb b/spec/classes/ironic_inspector_spec.rb index 9adbbb9f..c5709e02 100644 --- a/spec/classes/ironic_inspector_spec.rb +++ b/spec/classes/ironic_inspector_spec.rb @@ -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 diff --git a/templates/inspector_dnsmasq_http.erb b/templates/inspector_dnsmasq_http.erb index 645cf162..de99c9d6 100644 --- a/templates/inspector_dnsmasq_http.erb +++ b/templates/inspector_dnsmasq_http.erb @@ -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'] -%> diff --git a/templates/inspector_dnsmasq_tftp.erb b/templates/inspector_dnsmasq_tftp.erb index f714cd73..3ec03dfa 100644 --- a/templates/inspector_dnsmasq_tftp.erb +++ b/templates/inspector_dnsmasq_tftp.erb @@ -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'] -%>