take hiera out of the params
authormh <mh@immerda.ch>
Thu, 14 Jun 2012 15:00:43 +0000 (12:00 -0300)
committermh <mh@immerda.ch>
Thu, 14 Jun 2012 15:00:43 +0000 (12:00 -0300)
manifests/init.pp
templates/resolvconf.OpenBSD.erb
templates/resolvconf.erb

index 950598e..c22c4ea 100644 (file)
 # the Free Software Foundation.
 #
 
-class resolvconf {
+class resolvconf(
+  $domain = $::domain,  
+  $search = $::domain,
+  $nameservers = [ '8.8.8.8' ]
+) {
   file{'/etc/resolv.conf':
     content => $::operatingsystem ? {
       openbsd => template("resolvconf/resolvconf.${::operatingsystem}.erb"),
index be19f8e..48daf27 100644 (file)
@@ -1,6 +1,5 @@
 # managed by puppet
 lookup file bind
-<% Puppet::Parser::Functions.function('hiera') -%>
-<% scope.function_hiera('resolvconf_nameservers',['8.8.8.8']).each do |nameserver| -%>
+<% scope.lookupvar('resolvconf::nameservers').each do |nameserver| -%>
 nameserver <%= nameserver %> 
 <% end -%>
index dc98aea..d8136bf 100644 (file)
@@ -1,8 +1,7 @@
 # managed by puppet
-<% Puppet::Parser::Functions.function('hiera') -%>
-domain <%= scope.function_hiera('resolvconf_domain',domain) %>
-search <%= scope.function_hiera('resolvconf_search',domain) %>
+domain <%= scope.lookupvar('resolvconf::domain') %>
+search <%= scope.lookupvar('resolvconf::search') %>
 
-<% scope.function_hiera('resolvconf_nameservers',['8.8.8.8']).each do |nameserver| -%>
+<% scope.lookupvar('resolvconf::nameservers').each do |nameserver| -%>
 nameserver <%= nameserver %>
 <% end -%>