Turn on DHCP logging in ironic-inspector when debug is true

Thanks to Dan Radez for pointing out this cool feature to me.

Change-Id: Ica31ab87b646e3bad21d55ba939437094f42cf9c
This commit is contained in:
Dmitry Tantsur 2017-10-17 12:35:30 +02:00
parent b02d9c3056
commit c9951abf87
4 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
features:
- |
When ``inspector::debug`` is set to ``true``, DHCP queries and responses
will be logged by the ironic-inspector dnsmasq services.

View File

@ -227,6 +227,12 @@ describe 'ironic::inspector' do
is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
/dhcp-range=192.168.0.100,192.168.0.120,10m/
)
is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
/log-dhcp/
)
is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
/log-queries/
)
end
it 'should contain file /var/www/httpboot/inspector.ipxe' do
is_expected.to contain_file('/var/www/httpboot/inspector.ipxe').with(

View File

@ -1,6 +1,10 @@
port=0
interface=<%= @dnsmasq_interface %>
bind-interfaces
<% if @debug %>
log-dhcp
log-queries
<% 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

View File

@ -1,6 +1,10 @@
port=0
interface=<%= @dnsmasq_interface %>
bind-interfaces
<% if @debug %>
log-dhcp
log-queries
<% 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