From c7eca077fdda063edc96d3bea02c4774569e4b10 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 14 Jun 2012 12:00:43 -0300 Subject: take hiera out of the params --- manifests/init.pp | 6 +++++- templates/resolvconf.OpenBSD.erb | 3 +-- templates/resolvconf.erb | 7 +++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 950598e..c22c4ea 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -12,7 +12,11 @@ # 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"), diff --git a/templates/resolvconf.OpenBSD.erb b/templates/resolvconf.OpenBSD.erb index be19f8e..48daf27 100644 --- a/templates/resolvconf.OpenBSD.erb +++ b/templates/resolvconf.OpenBSD.erb @@ -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 -%> diff --git a/templates/resolvconf.erb b/templates/resolvconf.erb index dc98aea..d8136bf 100644 --- a/templates/resolvconf.erb +++ b/templates/resolvconf.erb @@ -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 -%> -- cgit v1.2.3