aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorCédric Jeanneret <cedric.jeanneret@camptocamp.com>2013-02-26 12:52:41 +0000
committerCédric Jeanneret <cedric.jeanneret@camptocamp.com>2013-02-26 12:52:41 +0000
commit3fbb21df04f007d76f5c816e0ba7a3bd09fade54 (patch)
tree14c0f849c5c76b858392002c884bc9118653ee94 /templates
parentaa3d9f040b590b492ef8cbb53a179db5bdeb1508 (diff)
downloadpuppet-dhcp-3fbb21df04f007d76f5c816e0ba7a3bd09fade54.tar.gz
puppet-dhcp-3fbb21df04f007d76f5c816e0ba7a3bd09fade54.tar.bz2
updated host.conf.erb in order to use hashes
Diffstat (limited to 'templates')
-rw-r--r--templates/host.conf.erb18
1 files changed, 11 insertions, 7 deletions
diff --git a/templates/host.conf.erb b/templates/host.conf.erb
index 20ba6e6..c3514d3 100644
--- a/templates/host.conf.erb
+++ b/templates/host.conf.erb
@@ -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 -%>