]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Parametrize dhclient class
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 31 Mar 2013 23:25:34 +0000 (20:25 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 31 Mar 2013 23:25:34 +0000 (20:25 -0300)
manifests/subsystems/dhclient.pp
templates/dhcp/dhclient.conf.erb

index 7c4ebf49bafb52cc28f9839a5f0e58ecefa85495..b901d2b1bf1e9cb6f6294ef0f4c2b9b13fc4b4eb 100644 (file)
@@ -1,10 +1,13 @@
-class dhclient {
+class dhclient(
+  $ensure           = hiera('nodo::dhclient::manage',           'present'),
+  $supersede_domain = hiera('nodo::dhclient::supersede_domain', '')
+) {
   package { 'isc-dhcp-client':
-    ensure => present,
+    ensure => $ensure,
   }
 
   file { '/etc/dhcp/dhclient.conf':
-    ensure  => present,
+    ensure  => $ensure,
     owner   => root,
     group   => root,
     mode    => 0644,
index 39eeeb53fb2a5762f46509b61e39e4e6c15c207b..dfc465d486c7373314d6774dc00b2af7573f99e5 100644 (file)
@@ -18,9 +18,11 @@ option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
 #send dhcp-lease-time 3600;
 #prepend domain-name-servers 127.0.0.1;
 
+<%- if $supersede_domain != '' then -%>
 # Force a domain name, otherwise facter and other configurations might break.
 supersede domain-name "<%= domain %>";
 supersede domain-search "<%= domain %>";
+<%- end -%>
 
 request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, domain-search, host-name,