Allow customizing log output of dnsmasq services
This change introduces the new dnsmasq_log_facility parameter so that users can customize log output from dsnmasq processes. Change-Id: Ied9b42432cf12f0ea84b27a93389805589db3f30
This commit is contained in:
parent
c018b74615
commit
f0f6163f43
@ -112,6 +112,10 @@
|
||||
# filter.
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*dnsmasq_log_facility*]
|
||||
# (optional) Log facility of the dnsmasq process.
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*sync_db*]
|
||||
# Enable dbsync
|
||||
# Defaults to true
|
||||
@ -209,6 +213,7 @@ class ironic::inspector (
|
||||
$dnsmasq_local_ip = '192.168.0.1',
|
||||
$dnsmasq_dhcp_sequential_ip = true,
|
||||
$dnsmasq_dhcp_hostsdir = undef,
|
||||
$dnsmasq_log_facility = undef,
|
||||
$sync_db = true,
|
||||
$ramdisk_collectors = 'default',
|
||||
$ramdisk_filename = 'agent.ramdisk',
|
||||
|
@ -64,6 +64,10 @@
|
||||
# service facilitator.
|
||||
# Defaults to ironic::params::xinetd_available
|
||||
#
|
||||
# [*dnsmasq_log_facility*]
|
||||
# (optional) Log facility of the dnsmasq process to server tftp server.
|
||||
# Defaults to undef
|
||||
#
|
||||
# DEPRECATED PARAMETERS
|
||||
#
|
||||
# [*enable_ppc64le*]
|
||||
@ -81,6 +85,7 @@ class ironic::pxe (
|
||||
$ipxe_name_base = 'ipxe-snponly',
|
||||
$uefi_ipxe_bootfile_name = 'snponly.efi',
|
||||
$tftp_use_xinetd = $::ironic::params::xinetd_available,
|
||||
$dnsmasq_log_facility = undef,
|
||||
# DEPRECATED PARAMETERS
|
||||
$enable_ppc64le = undef
|
||||
) inherits ironic::params {
|
||||
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The new ``dnsmasq_log_faciliy`` parameter has been added to the following
|
||||
two classes.
|
||||
|
||||
- ``ironic::pxe``
|
||||
- ``ironic::inspector``
|
@ -174,6 +174,9 @@ describe 'ironic::inspector' do
|
||||
is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
|
||||
/dhcp-sequential-ip/
|
||||
)
|
||||
is_expected.not_to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
|
||||
/log-facility=.*/
|
||||
)
|
||||
end
|
||||
it 'should contain file /tftpboot/pxelinux.cfg/default' do
|
||||
is_expected.to contain_file('/tftpboot/pxelinux.cfg/default').with(
|
||||
@ -206,6 +209,7 @@ describe 'ironic::inspector' do
|
||||
:discovery_default_driver => 'pxe_ipmitool',
|
||||
:dnsmasq_ip_subnets => [{'ip_range' => '192.168.0.100,192.168.0.120'}],
|
||||
:dnsmasq_dhcp_sequential_ip => false,
|
||||
:dnsmasq_log_facility => '/var/log/ironic-inspector/dnsmasq.log',
|
||||
:add_ports => 'all',
|
||||
:always_store_ramdisk_logs => true,
|
||||
:port_physnet_cidr_map => {'192.168.20.0/24' => 'physnet_a',
|
||||
@ -252,6 +256,9 @@ describe 'ironic::inspector' do
|
||||
is_expected.not_to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
|
||||
/dhcp-sequential-ip/
|
||||
)
|
||||
is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
|
||||
/log-facility=\/var\/log\/ironic-inspector\/dnsmasq.log/
|
||||
)
|
||||
is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
|
||||
/dhcp-boot=tag:efi,tag:!ipxe,otherpxe.efi/
|
||||
)
|
||||
|
@ -6,3 +6,6 @@ tftp-root=<%= @tftp_root_real %>
|
||||
<% if @tftp_bind_host -%>
|
||||
listen-address=<%= @tftp_bind_host %>
|
||||
<% end -%>
|
||||
<% if ! @dnsmasq_log_facility.nil? -%>
|
||||
log-facility=<%= @dnsmasq_log_facility %>
|
||||
<% end -%>
|
||||
|
@ -4,6 +4,9 @@ interface=<%= @dnsmasq_interface %>
|
||||
log-dhcp
|
||||
log-queries
|
||||
<% end %>
|
||||
<% if ! @dnsmasq_log_facility.nil? %>
|
||||
log-facility=<%= @dnsmasq_log_facility %>
|
||||
<% end -%>
|
||||
<% @dnsmasq_ip_subnets_real.each do |s| -%>
|
||||
<% if s['tag'] and s['netmask'] -%>
|
||||
dhcp-range=set:<%= s['tag'] -%>,<%= s['ip_range'] -%>,<%= s['netmask'] -%>,10m
|
||||
|
Loading…
Reference in New Issue
Block a user