aboutsummaryrefslogtreecommitdiff
path: root/templates/subnet.conf.erb
blob: 11f9ed4f910d68dda61f6e1b558f73f4cf385fc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File managed by puppet

<%-
  _netmask = @netmask || scope.lookupvar('::netmask_eth0')
  scope.function_validate_re([_netmask, @ip_re]) -%>
subnet <%= @name %> netmask <%= _netmask %> {
<%-
  _routers = @routers unless @routers.empty?
  _routers ||= [scope.lookupvar('::netmask_eth0')]
  scope.function_validate_array([_routers]) -%>
  option routers <%= _routers.collect! {|i| "#{i}" }.join(',') %>;
<%-
  _subnet_mask = @subnet_mask || _netmask
  scope.function_validate_re([_subnet_mask, @ip_re]) -%>
  option subnet-mask <%= _subnet_mask %>;
  option broadcast-address <%= @broadcast %>;
<%-
  _domain_name = @domain_name || scope.lookupvar('::domain')
  scope.function_validate_re([_domain_name, '^\S+$']) -%>
  option domain-name "<%= _domain_name %>";
<% unless @other_opts.empty? -%>
  <% if @other_opts.is_a?(Array) -%>
<%= @other_opts.collect! {|i| "  #{i};"}.join("\n") %>
  <% else -%>
  <%= @other_opts %>;
  <% end -%>
<% end -%>
}