Browse Source

inspector dnsmasq: make sequential-ip configurable

Add the parameter ``dnsmasq_dhcp_sequential_ip`` to the
ironic::inspector class. When true (the default) dnsmasq
is configured to serve addresses in sequential orders.

Some DHCPv6 clients don't operate well with a DHCP server
that serves addresses sequentially. The new parameter
allow disabling sequential addressing to improve
interoperability with DHCPv6 clients in UEFI firmware.

Closes-Bug: #1941908
Change-Id: Iad32434790a1744249b284937c6b67e9b58a235f
(cherry picked from commit 4f67b341ee)
(cherry picked from commit dc1ebc4ff5)
(cherry picked from commit 09196e4ae5)
changes/49/819849/1
Harald Jensås 9 months ago committed by Takashi Kajinami
parent
commit
03e3968add
  1. 5
      manifests/inspector.pp
  2. 7
      releasenotes/notes/dnsmasq-sequential-ip-configurable-739924e5ee69a51d.yaml
  3. 7
      spec/classes/ironic_inspector_spec.rb
  4. 2
      templates/inspector_dnsmasq_http.erb
  5. 2
      templates/inspector_dnsmasq_tftp.erb

5
manifests/inspector.pp

@ -103,6 +103,10 @@
# (optional) IP interface for the dnsmasq process
# Defaults to '192.168.0.1'
#
# [*dnsmasq_dhcp_sequential_ip*]
# (optional) When true enable the 'dhcp-sequential-ip' option for dnsmasq.
# Defaults to true
#
# [*dnsmasq_dhcp_hostsdir*]
# (optional) directory with DHCP hosts, only used with the "dnsmasq" PXE
# filter.
@ -274,6 +278,7 @@ class ironic::inspector (
$store_data = 'none',
$dnsmasq_ip_subnets = [],
$dnsmasq_local_ip = '192.168.0.1',
$dnsmasq_dhcp_sequential_ip = true,
$dnsmasq_dhcp_hostsdir = undef,
$sync_db = true,
$ramdisk_collectors = 'default',

7
releasenotes/notes/dnsmasq-sequential-ip-configurable-739924e5ee69a51d.yaml

@ -0,0 +1,7 @@
---
features:
- |
It is now possible to disable sequential ip addressing in the ironic
inspector dnsmasq service. The ``ironic::inspector`` class has the new
parameter ``dnsmasq_dhcp_sequential_ip`` *(defaults to: true)*. Set it
to ``false`` to disable sequential ip addressing.

7
spec/classes/ironic_inspector_spec.rb

@ -193,6 +193,9 @@ describe 'ironic::inspector' do
is_expected.not_to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
/dhcp-option=tag:subnet3,option:router,2001:4888:a03:313a:c0:fe0:0:c000/
)
is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
/dhcp-sequential-ip/
)
end
it 'should contain file /tftpboot/pxelinux.cfg/default' do
is_expected.to contain_file('/tftpboot/pxelinux.cfg/default').with(
@ -231,6 +234,7 @@ describe 'ironic::inspector' do
:node_not_found_hook => 'enroll',
:discovery_default_driver => 'pxe_ipmitool',
:dnsmasq_ip_subnets => [{'ip_range' => '192.168.0.100,192.168.0.120'}],
:dnsmasq_dhcp_sequential_ip => false,
:add_ports => 'all',
:always_store_ramdisk_logs => true,
:port_physnet_cidr_map => {'192.168.20.0/24' => 'physnet_a',
@ -280,6 +284,9 @@ describe 'ironic::inspector' do
is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
/dhcp-option=tag:ipxe6,option6:bootfile-url,http:\/\/.*:3816\/inspector.ipxe/
)
is_expected.not_to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
/dhcp-sequential-ip/
)
end
it 'should contain file /var/www/httpboot/inspector.ipxe' do
is_expected.to contain_file('/var/www/httpboot/inspector.ipxe').with(

2
templates/inspector_dnsmasq_http.erb

@ -38,7 +38,9 @@ dhcp-option=option:classless-static-route,<%= @_routes.join(',') -%>
<% end -%>
<% end -%>
<% end -%>
<% if @dnsmasq_dhcp_sequential_ip -%>
dhcp-sequential-ip
<% end -%>
dhcp-match=ipxe,175
dhcp-match=set:efi,option:client-arch,7
dhcp-match=set:efi,option:client-arch,9

2
templates/inspector_dnsmasq_tftp.erb

@ -39,7 +39,9 @@ dhcp-option=option:classless-static-route,<%= @_routes.join(',') -%>
<% end -%>
<% end -%>
dhcp-boot=pxelinux.0,localhost.localdomain,<%= @dnsmasq_local_ip %>
<% if @dnsmasq_dhcp_sequential_ip -%>
dhcp-sequential-ip
<% end -%>
<% if @dnsmasq_dhcp_hostsdir %>
dhcp-hostsdir=<%= @dnsmasq_dhcp_hostsdir %>
<% end %>

Loading…
Cancel
Save