dhcp-agent: Support more dnsmasq_* parameters
Change-Id: I8fd20c07986a4ac571b458cea1acc170af558ddc
This commit is contained in:
@@ -45,11 +45,19 @@
|
|||||||
# (optional) List of servers to use as dnsmasq forwarders.
|
# (optional) List of servers to use as dnsmasq forwarders.
|
||||||
# Defaults to $::os_service_default.
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
|
# [*dnsmasq_base_log_dir*]
|
||||||
|
# (optional) base log dir for dnsmasq logging.
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
# [*dnsmasq_local_resolv*]
|
# [*dnsmasq_local_resolv*]
|
||||||
# (optional) Enables the dnsmasq service to provide name resolution for instances
|
# (optional) Enables the dnsmasq service to provide name resolution for instances
|
||||||
# via DNS resolvers on the host running the DHCP agent.
|
# via DNS resolvers on the host running the DHCP agent.
|
||||||
# Defaults to $::os_service_default.
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
|
# [*dnsmasq_lease_max*]
|
||||||
|
# (optional) Limit number of leases to prevent a denial-of-service.
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
# [*dnsmasq_enable_addr6_list*]
|
# [*dnsmasq_enable_addr6_list*]
|
||||||
# (optional) Enable dhcp-host entry with list of addresses when port has
|
# (optional) Enable dhcp-host entry with list of addresses when port has
|
||||||
# multiple IPv6 addresses in the same subnet.
|
# multiple IPv6 addresses in the same subnet.
|
||||||
@@ -126,7 +134,9 @@ class neutron::agents::dhcp (
|
|||||||
$root_helper = 'sudo neutron-rootwrap /etc/neutron/rootwrap.conf',
|
$root_helper = 'sudo neutron-rootwrap /etc/neutron/rootwrap.conf',
|
||||||
$dnsmasq_config_file = $::os_service_default,
|
$dnsmasq_config_file = $::os_service_default,
|
||||||
$dnsmasq_dns_servers = $::os_service_default,
|
$dnsmasq_dns_servers = $::os_service_default,
|
||||||
|
$dnsmasq_base_log_dir = $::os_service_default,
|
||||||
$dnsmasq_local_resolv = $::os_service_default,
|
$dnsmasq_local_resolv = $::os_service_default,
|
||||||
|
$dnsmasq_lease_max = $::os_service_default,
|
||||||
$dnsmasq_enable_addr6_list = $::os_service_default,
|
$dnsmasq_enable_addr6_list = $::os_service_default,
|
||||||
$enable_isolated_metadata = false,
|
$enable_isolated_metadata = false,
|
||||||
$enable_force_metadata = $::os_service_default,
|
$enable_force_metadata = $::os_service_default,
|
||||||
@@ -173,7 +183,9 @@ class neutron::agents::dhcp (
|
|||||||
'DEFAULT/dhcp_broadcast_reply': value => $dhcp_broadcast_reply;
|
'DEFAULT/dhcp_broadcast_reply': value => $dhcp_broadcast_reply;
|
||||||
'DEFAULT/dnsmasq_config_file': value => $dnsmasq_config_file;
|
'DEFAULT/dnsmasq_config_file': value => $dnsmasq_config_file;
|
||||||
'DEFAULT/dnsmasq_dns_servers': value => join(any2array($dnsmasq_dns_servers), ',');
|
'DEFAULT/dnsmasq_dns_servers': value => join(any2array($dnsmasq_dns_servers), ',');
|
||||||
|
'DEFAULT/dnsmasq_base_log_dir': value => $dnsmasq_base_log_dir;
|
||||||
'DEFAULT/dnsmasq_local_resolv': value => $dnsmasq_local_resolv;
|
'DEFAULT/dnsmasq_local_resolv': value => $dnsmasq_local_resolv;
|
||||||
|
'DEFAULT/dnsmasq_lease_max': value => $dnsmasq_lease_max;
|
||||||
'DEFAULT/dnsmasq_enable_addr6_list': value => $dnsmasq_enable_addr6_list;
|
'DEFAULT/dnsmasq_enable_addr6_list': value => $dnsmasq_enable_addr6_list;
|
||||||
'agent/availability_zone': value => $availability_zone;
|
'agent/availability_zone': value => $availability_zone;
|
||||||
'agent/report_interval': value => $report_interval;
|
'agent/report_interval': value => $report_interval;
|
||||||
|
8
releasenotes/notes/dnsmasq-opts-13586d1973e7cb07.yaml
Normal file
8
releasenotes/notes/dnsmasq-opts-13586d1973e7cb07.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The following parameters have been added to the ``neutron::agent::dhcp``
|
||||||
|
class.
|
||||||
|
|
||||||
|
- ``dnsmasq_base_log_dir``
|
||||||
|
- ``dnsmasq_lease_max``
|
@@ -181,45 +181,31 @@ describe 'neutron::agents::dhcp' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when enabling dhcp-host entry with list of addresses' do
|
context 'with dnsmasq parameters' do
|
||||||
before :each do
|
before :each do
|
||||||
params.merge!(:dnsmasq_enable_addr6_list => true)
|
params.merge!({
|
||||||
|
:dnsmasq_config_file => '/foo',
|
||||||
|
:dnsmasq_dns_servers => ['192.0.2.11', '192.0.2.12'],
|
||||||
|
:dnsmasq_base_log_dir => '/var/log/neutron',
|
||||||
|
:dnsmasq_local_resolv => true,
|
||||||
|
:dnsmasq_lease_max => 16777216,
|
||||||
|
:dnsmasq_enable_addr6_list => false,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
it 'should enabling dhcp-host entry with list of addresses' do
|
|
||||||
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_enable_addr6_list').with_value('true');
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with dnsmasq_config_file specified' do
|
it 'should configure the dnsmasq parameters' do
|
||||||
before do
|
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_config_file')\
|
||||||
params.merge!(
|
.with_value(params[:dnsmasq_config_file])
|
||||||
:dnsmasq_config_file => '/foo'
|
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_dns_servers')\
|
||||||
)
|
.with_value(params[:dnsmasq_dns_servers].join(','))
|
||||||
end
|
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_base_log_dir')\
|
||||||
it 'configures dnsmasq_config_file' do
|
.with_value(params[:dnsmasq_base_log_dir])
|
||||||
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_config_file').with_value(params[:dnsmasq_config_file])
|
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_local_resolv')\
|
||||||
end
|
.with_value(params[:dnsmasq_local_resolv])
|
||||||
end
|
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_lease_max')\
|
||||||
|
.with_value(params[:dnsmasq_lease_max])
|
||||||
context 'enable advertisement of the DNS resolver on the host.' do
|
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_enable_addr6_list')\
|
||||||
before do
|
.with_value(params[:dnsmasq_enable_addr6_list]);
|
||||||
params.merge!(
|
|
||||||
:dnsmasq_local_resolv => true
|
|
||||||
)
|
|
||||||
end
|
|
||||||
it 'configures dnsmasq_local_resolv' do
|
|
||||||
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_local_resolv').with_value(params[:dnsmasq_local_resolv])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with dnsmasq_dns_servers set' do
|
|
||||||
before do
|
|
||||||
params.merge!(
|
|
||||||
:dnsmasq_dns_servers => ['1.2.3.4','5.6.7.8']
|
|
||||||
)
|
|
||||||
end
|
|
||||||
it 'should set dnsmasq_dns_servers' do
|
|
||||||
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_dns_servers').with_value(params[:dnsmasq_dns_servers].join(','))
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user