diff --git a/releasenotes/notes/increase-inspector-dnsmasq-lease-7e5b03941f3e161c.yaml b/releasenotes/notes/increase-inspector-dnsmasq-lease-7e5b03941f3e161c.yaml new file mode 100644 index 00000000..ea3387c9 --- /dev/null +++ b/releasenotes/notes/increase-inspector-dnsmasq-lease-7e5b03941f3e161c.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - Increase the Inspector DHCP lease time that is provide by dnsmasq to 10 + minutes. A shorter lease time may cause the provided IP address to expire + and IPA may not add the address to the introspection report. diff --git a/spec/classes/ironic_inspector_spec.rb b/spec/classes/ironic_inspector_spec.rb index 5911491a..148214b3 100644 --- a/spec/classes/ironic_inspector_spec.rb +++ b/spec/classes/ironic_inspector_spec.rb @@ -141,16 +141,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,2m/ + /dhcp-range=192.168.0.100,192.168.0.120,10m/ ) 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,2m/ + /dhcp-range=set:subnet1,192.168.1.100,192.168.1.200,255.255.255.0,10m/ ) 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,2m/ + /dhcp-range=set:subnet2,192.168.2.100,192.168.2.200,255.255.255.0,10m/ ) is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content( /dhcp-option=tag:subnet2,option:router,192.168.2.254/ @@ -225,7 +225,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,2m/ + /dhcp-range=192.168.0.100,192.168.0.120,10m/ ) 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 d68db179..92d14ee8 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'] -%>,2m +dhcp-range=set:<%= s['tag'] -%>,<%= s['ip_range'] -%>,<%= s['netmask'] -%>,10m <% elsif s['tag'] -%> -dhcp-range=set:<%= s['tag'] -%>,<%= s['ip_range'] -%>,2m +dhcp-range=set:<%= s['tag'] -%>,<%= s['ip_range'] -%>,10m <% else -%> -dhcp-range=<%= s['ip_range'] -%>,2m +dhcp-range=<%= s['ip_range'] -%>,10m <% end -%> <% if s['gateway'] -%> <% if s['tag'] -%> diff --git a/templates/inspector_dnsmasq_tftp.erb b/templates/inspector_dnsmasq_tftp.erb index 3ec03dfa..bf639f69 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'] -%>,2m +dhcp-range=set:<%= s['tag'] -%>,<%= s['ip_range'] -%>,<%= s['netmask'] -%>,10m <% elsif s['tag'] -%> -dhcp-range=set:<%= s['tag'] -%>,<%= s['ip_range'] -%>,2m +dhcp-range=set:<%= s['tag'] -%>,<%= s['ip_range'] -%>,10m <% else -%> -dhcp-range=<%= s['ip_range'] -%>,2m +dhcp-range=<%= s['ip_range'] -%>,10m <% end -%> <% if s['gateway'] -%> <% if s['tag'] -%>