]> gitweb.fluxo.info Git - puppet-dhcp.git/commitdiff
updated and corrected template and dhcp::hosts
authorCedric Jeanneret <cedric.jeanneret@camptocamp.com>
Tue, 26 Feb 2013 13:29:55 +0000 (14:29 +0100)
committerCedric Jeanneret <cedric.jeanneret@camptocamp.com>
Tue, 26 Feb 2013 13:29:55 +0000 (14:29 +0100)
manifests/hosts.pp
templates/host.conf.erb

index fd99600b1f54064ce861c12c4fd16e640bb0d3f1..b159449acb4d78153659956d13d9f8c60a557a98 100644 (file)
@@ -4,6 +4,9 @@
 #
 # Arguments
 # $template:  dhcp host template - default: 'dhcp/host.conf.erb'
+# $global_options: global options for the whole bunch of hosts.
+#                  you may override it per host, setting the host "options"
+#                  directly in the hash.
 # $subnet:    targeted subnet
 # $hash_data: hash containing data - default form:
 #      {
@@ -35,6 +38,7 @@
 define dhcp::hosts (
   $hash_data,
   $subnet,
+  $global_options = false,
   $template = 'dhcp/host.conf.erb',
 ) {
 
index c3514d34d41b1f0124ea9528d2dbbc6f37489145..e6a7073f6146bab8d8c0e1c88c28e6444e10b1e0 100644 (file)
@@ -3,12 +3,14 @@
 host <%= host %>-<%= if_name %> {
   hardware ethernet <%= if_mac %>;
 <% if datas.fetch('fixed_address', false) -%>
-  fixed-address <%= datas.fetch('fixed_address') %>
+  fixed-address <%= datas.fetch('fixed_address') %>;
 <% else -%>
-  fixed-address <%= host %>
+  fixed-address <%= host %>;
 <% end -%>
 <% if datas.fetch('option', false) -%>
   <%= datas.fetch('option') %>
+<% elsif @global_options -%>
+  <%= @global_options %>
 <% end -%>
 }
 <% end -%>