]> gitweb.fluxo.info Git - puppet-dhcp.git/commitdiff
updated host.conf.erb in order to use hashes
authorCédric Jeanneret <cedric.jeanneret@camptocamp.com>
Tue, 26 Feb 2013 12:52:41 +0000 (12:52 +0000)
committerCédric Jeanneret <cedric.jeanneret@camptocamp.com>
Tue, 26 Feb 2013 12:52:41 +0000 (12:52 +0000)
templates/host.conf.erb

index 20ba6e6cbfd7279f0ba06123441d87b9002e1fbb..c3514d34d41b1f0124ea9528d2dbbc6f37489145 100644 (file)
@@ -1,11 +1,15 @@
-host <%=name%> {
-  hardware ethernet <%=mac%>;
-<% if fixed_address -%>
-  fixed-address <%=fixed_address%>;
+<%- @hash_data.sort.each do |host, datas| -%>
+<%- datas.fetch('interfaces').sort.each do |if_name, if_mac| -%>
+host <%= host %>-<%= if_name %> {
+  hardware ethernet <%= if_mac %>;
+<% if datas.fetch('fixed_address', false) -%>
+  fixed-address <%= datas.fetch('fixed_address') %>
 <% else -%>
-  fixed-address <%=name%>;
+  fixed-address <%= host %>
 <% end -%>
-<% if options -%>
-  <%=options%>
+<% if datas.fetch('option', false) -%>
+  <%= datas.fetch('option') %>
 <% end -%>
 }
+<% end -%>
+<% end -%>