diff options
author | Jeanneret Cedric <contact@internux.ch> | 2013-04-10 22:37:10 -0700 |
---|---|---|
committer | Jeanneret Cedric <contact@internux.ch> | 2013-04-10 22:37:10 -0700 |
commit | 87162a8cc3e47996160f85e1807f75b9ad741bc8 (patch) | |
tree | d897d6ab4dd59c94ed40dc3333006a115700ca49 /templates/host.conf.erb | |
parent | 5486843f40439050f4aa6a94fab8d2bf45037942 (diff) | |
parent | ec52b52f8227e10a3724c21dde337a424bdcfe27 (diff) | |
download | puppet-dhcp-87162a8cc3e47996160f85e1807f75b9ad741bc8.tar.gz puppet-dhcp-87162a8cc3e47996160f85e1807f75b9ad741bc8.tar.bz2 |
Merge pull request #4 from cjeanneret/hosts-uses-hashes
Hosts uses hashes
Diffstat (limited to 'templates/host.conf.erb')
-rw-r--r-- | templates/host.conf.erb | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/templates/host.conf.erb b/templates/host.conf.erb index 20ba6e6..e6a7073 100644 --- a/templates/host.conf.erb +++ b/templates/host.conf.erb @@ -1,11 +1,17 @@ -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') %> +<% elsif @global_options -%> + <%= @global_options %> <% end -%> } +<% end -%> +<% end -%> |