Files
puppet-ironic/templates/inspector_dnsmasq_tftp.erb
Harald Jensås c192ee40ac Add support for classless-static-routes in inspector dnsmasq
Advanced users may need to push advanced routing to the client.
Add the possbility to configure the classless-static-route
(dhcp option: 121) in ironic inspectors dnsmasq.

Change-Id: I2229d386bff8ae63e4efe8406770b2b378a1991f
Related-Bug: #1819464
2019-03-12 18:27:39 +01:00

46 lines
1.4 KiB
Plaintext

port=0
interface=<%= @dnsmasq_interface %>
<% if @dhcp_debug_real %>
log-dhcp
log-queries
<% end %>
<% @dnsmasq_ip_subnets.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['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 %>
dhcp-sequential-ip
<% 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 -%>