]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
and options
authorStephen Gran <steve@lobefin.net>
Mon, 16 Apr 2012 10:31:02 +0000 (11:31 +0100)
committerStephen Gran <steve@lobefin.net>
Mon, 16 Apr 2012 10:31:02 +0000 (11:31 +0100)
Signed-off-by: Stephen Gran <steve@lobefin.net>
modules/resolv/manifests/init.pp
modules/resolv/templates/resolv.conf.erb

index 225c93c94644550cb6271fee099139718e049792..3447733a35588b12478f427270df15d3eaed6631 100644 (file)
@@ -1,7 +1,8 @@
 class resolv {
 
-       $ns = hiera('nameservers')
-       $sp = hiera('searchpaths')
+       $ns   = hiera('nameservers')
+       $sp   = hiera('searchpaths')
+       $opts = hiera('resolvoptions')
 
        file { '/etc/resolv.conf':
                        content => template('resolv/resolv.conf.erb');
index 147dfdf08205da7a04c58f14537e9a4f324ad4a0..a5291bfad5d09d6da453940c4701491a10040625 100644 (file)
@@ -6,19 +6,19 @@
 <%=
 nameservers = []
 searchpaths = []
-options = []
+options     = []
+resolvconf  = ''
 
 if %w{draghi liszt}.include?(hostname)
   nameservers << "127.0.0.1"
 end
 
 nameservers += scope.lookupvar('ns')
-options += scope.lookupvar('site::nodeinfo')['hoster']['resolvoptions'] if scope.lookupvar('site::nodeinfo')['hoster']['resolvoptions']
-
 searchpaths += scope.lookupvar('sp')
+options     += scope.lookupvar('opts')
+
 searchpaths << "debian.org"
 
-resolvconf  = ''
 resolvconf += "search " + searchpaths.to_a.flatten.join(" ") + "\n"
 
 if has_variable?('unbound') and unbound and unbound == "true"
@@ -36,7 +36,7 @@ else
   end
 end
 
-options.each do |opt|
+options.to_a.flatten.each do |opt|
   resolvconf += "options " + opt + "\n"
 end