# Marcel Haerry haerry+puppet(at)puzzle.ch
# Simon Josi josi+puppet(at)puzzle.ch
#
-# This program is free software; you can redistribute
-# it and/or modify it under the terms of the GNU
-# General Public License version 3 as published by
+# This program is free software; you can redistribute
+# it and/or modify it under the terms of the GNU
+# General Public License version 3 as published by
# the Free Software Foundation.
#
class resolvconf(
- $domain = $::domain,
+ $domain = $::domain,
$search = $::domain,
- $nameservers = [ '8.8.8.8' ]
+ $nameservers = [
+ '77.109.138.45',
+ '77.109.139.29',
+ ]
) {
+ $content = $::operatingsystem ? {
+ openbsd => template("resolvconf/resolvconf.${::operatingsystem}.erb"),
+ default => template('resolvconf/resolvconf.erb'),
+ }
file{'/etc/resolv.conf':
- content => $::operatingsystem ? {
- openbsd => template("resolvconf/resolvconf.${::operatingsystem}.erb"),
- default => template('resolvconf/resolvconf.erb'),
- },
- owner => root, group => 0, mode => 0444;
+ content => $content,
+ owner => root,
+ group => 0,
+ mode => '0444';
}
}
# managed by puppet
-domain <%= scope.lookupvar('resolvconf::domain') %>
-search <%= scope.lookupvar('resolvconf::search') %>
+<% if @domain -%>domain <%= @domain %><% end -%>
+<% if @search -%>search <%= @search %><% end -%>
-<% scope.lookupvar('resolvconf::nameservers').each do |nameserver| -%>
+<% Array(@nameservers).each do |nameserver| -%>
nameserver <%= nameserver %>
<% end -%>