]> git.openstreetmap.org Git - chef.git/blob - cookbooks/networking/templates/default/network.erb
Fix path to rails storage
[chef.git] / cookbooks / networking / templates / default / network.erb
1 [Match]
2 Name=<%= @interface[:interface] %>
3
4 [Network]
5 <% if @interface.dig(:inet6, :dhcp) -%>
6 DHCP=ipv6
7 <% end -%>
8 <% if @interface[:inet] -%>
9 Address=<%= @interface[:inet][:address] %>/<%== @interface[:inet][:prefix] %>
10 <% end -%>
11 <% if @interface[:inet6] -%>
12 Address=<%= @interface[:inet6][:address] %>/<%== @interface[:inet6][:prefix] %>
13 <% end -%>
14 IPv6AcceptRA=no
15 <% Array(@interface[:vlans]).sort.uniq.each do |vlan| -%>
16 VLAN=<%= @interface[:interface] %>.<%= vlan %>
17 <% end -%>
18 <% if @interface.dig(:inet6, :dhcp) -%>
19
20 [DHCPv6]
21 <% if @interface[:inet6][:dhcp][:duidtype] -%>
22 DUIDType=<%= @interface[:inet6][:dhcp][:duidtype] %>
23 <% end -%>
24 <% if @interface[:inet6][:dhcp][:duidrawdata] -%>
25 DUIDRawData=<%= @interface[:inet6][:dhcp][:duidrawdata] %>
26 <% end -%>
27 WithoutRA=solicit
28 <% end -%>
29 <% if @interface.dig(:inet, :gateway) && @interface[:inet][:gateway] != @interface[:inet][:address] -%>
30
31 [Route]
32 Gateway=<%= @interface[:inet][:gateway] %>
33 GatewayOnLink=true
34 <% if @interface[:metric] -%>
35 Metric=<%= @interface[:metric] %>
36 <% end -%>
37 <% end -%>
38 <% if @interface.dig(:inet6, :gateway) && @interface[:inet6][:gateway] != @interface[:inet6][:address] -%>
39
40 [Route]
41 Gateway=<%= @interface[:inet6][:gateway] %>
42 GatewayOnLink=true
43 <% if @interface[:metric] -%>
44 Metric=<%= @interface[:metric] %>
45 <% end -%>
46 <% end -%>
47 <% Hash(@interface.dig(:inet, :routes)).sort.each do |destination, details| -%>
48 <% unless details[:via] == @interface[:inet][:address] -%>
49
50 [Route]
51 <% if details[:via] -%>
52 Gateway=<%= details[:via] %>
53 <% end -%>
54 Destination=<%= destination %>
55 <% if details[:metric] -%>
56 Metric=<%= details[:metric] %>
57 <% end -%>
58 <% if details[:type] -%>
59 Type=<%= details[:type] %>
60 <% end -%>
61 <% end -%>
62 <% end -%>
63 <% Hash(@interface.dig(:inet6, :routes)).sort.each do |destination, details| -%>
64 <% unless details[:via] == @interface[:inet6][:address] -%>
65
66 [Route]
67 <% if details[:via] -%>
68 Gateway=<%= details[:via] %>
69 <% end -%>
70 Destination=<%= destination %>
71 <% if details[:metric] -%>
72 Metric=<%= details[:metric] %>
73 <% end -%>
74 <% if details[:type] -%>
75 Type=<%= details[:type] %>
76 <% end -%>
77 <% end -%>
78 <% end -%>