puppet-ironic/templates/inspector_dnsmasq_tftp.erb
Takashi Kajinami e1a89eb585 inspector: Fix missing new line in dnsmasq.conf with multiple subnets
... and make pattern match for inspector dnsmasq.conf more
strict to  detect missing new lines or unnecessary elements.

Closes-Bug: #2042526
Change-Id: I03abeb7c1519f5a2cbcddaa3722d4053eab3566f
2023-11-02 14:48:18 +09:00

58 lines
1.7 KiB
Plaintext

port=0
interface=<%= @dnsmasq_interface %>
<% if @dhcp_debug %>
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
<% elsif s['tag'] -%>
dhcp-range=set:<%= s['tag'] -%>,<%= s['ip_range'] -%>,10m
<% else -%>
dhcp-range=<%= s['ip_range'] -%>,10m
<% end -%>
<% if s['gateway'] -%>
<% if s['tag'] -%>
dhcp-option=tag:<%= s['tag'] -%>,option:router,<%= s['gateway'] %>
<% else -%>
dhcp-option=option:router,<%= s['gateway'] %>
<% end -%>
<% end -%>
<% if s['mtu'] -%>
<% if s['tag'] -%>
dhcp-option-force=tag:<%= s['tag'] -%>,option:mtu,<%= s['mtu'] %>
<% else -%>
dhcp-option-force=option:mtu,<%= s['mtu'] %>
<% end -%>
<% end -%>
<% if s['classless_static_routes'] -%>
<%- @_routes = [] -%>
<%- s['classless_static_routes'].each do |route| -%>
<%- @_routes << route['destination'] + ',' + route['nexthop'] -%>
<% end -%>
<% if s['tag'] -%>
dhcp-option=tag:<%= s['tag'] -%>,option:classless-static-route,<%= @_routes.join(',') %>
<% else -%>
dhcp-option=option:classless-static-route,<%= @_routes.join(',') %>
<% end -%>
<% 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 %>
<% if @enable_ppc64le -%>
# Client is ppc64le (OPAL) box and doesn't need a chain loader, but does need a custom config
dhcp-match=set:ppc64le,option:client-arch,14
dhcp-boot=tag:ppc64le,
dhcp-option=tag:ppc64le, 210,<%= @tftp_root_real %>/ppc64le/
dhcp-option=tag:ppc64le, 209,default
<% end -%>