aboutsummaryrefslogtreecommitdiff
path: root/templates/subnet.conf.erb
blob: 9592a4c46cbf5cf649f8e326d0e442864c0f4964 (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
29
30
31
32
33
34
35
36
# 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.each do |i|
    if i =~ /(\{|\})/
-%>
  <%= i %>
<%- else -%>
  <%= i %>;
<% end -%>
<% end -%>
<% else -%>
  <%= @other_opts %>;
<% end -%>
<% end -%>
}