diff options
Diffstat (limited to 'manifests/init.pp')
-rw-r--r-- | manifests/init.pp | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index e444480..58dc83f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,25 +4,37 @@ # modules_dir { "resolvconf": } -class resolvconf {} - -define resolvconf::create ( - $domain='glei.ch', - $search='glei.ch', - $nameserver1='212.103.67.60', - $nameserver2='212.103.72.231', - $nameserver3='192.168.1.104' -) { - $str = "search $search -domain $domain -nameserver $nameserver1 -nameserver $nameserver2 -nameserver $nameserver3 -" - - file { "/etc/resolv.conf": - content => $str +class resolvconf { + $real_resolvconf_domain = $resolvconf_domain ? { + '' => 'glei.ch', + default => $resolvconf_domain, } + $real_resolvconf_search = $resolvconf_search ? { + '' => 'glei.ch', + default => $resolvconf_search, + } + $real_resolvconf_nameserver1 = $resolvconf_nameserver1 ? { + '' => '212.103.67.60', + default => $resolvconf_nameserver1, + } + $real_resolvconf_nameserver2 = $resolvconf_nameserver2 ? { + '' => '212.103.72.231', + default => $resolvconf_nameserver2, + } + $real_resolvconf_nameserver3 = $resolvconf_nameserver3 ? { + '' => '192.168.1.104', + default => $resolvconf_nameserver3, + } + + file { '/etc/resolv.conf': + path => '/etc/resolv.conf', + owner => root, + group => 0, + mode => 444, + content => template("resolvconf/resolvconf.erb") + } + + } |