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
This commit is contained in:
Harald Jensås 2021-08-27 18:21:49 +02:00 committed by Takashi Kajinami
parent e4cc88ec8d
commit 4f67b341ee
5 changed files with 23 additions and 0 deletions

View File

@ -99,6 +99,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.
@ -273,6 +277,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',

View File

@ -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.

View File

@ -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(

View File

@ -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

View File

@ -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 %>