diff options
author | Marcel Haerry <haerry@puzzle.ch> | 2009-05-25 10:53:10 +0200 |
---|---|---|
committer | Marcel Haerry <haerry@puzzle.ch> | 2009-05-25 10:53:10 +0200 |
commit | c1af334f136fe24ad1a544142dfa8ffed1325657 (patch) | |
tree | b2394a525b7a1cd74335abe6767f7b63a763a5fd | |
parent | 4a235226de70fed2c1679c4ec8a432b4c74a65cd (diff) | |
parent | 1c77a21234e5ba32f4a7c03c727e3e20119784c3 (diff) | |
download | puppet-resolvconf-c1af334f136fe24ad1a544142dfa8ffed1325657.tar.gz puppet-resolvconf-c1af334f136fe24ad1a544142dfa8ffed1325657.tar.bz2 |
merged with immerda
-rw-r--r-- | manifests/init.pp | 27 | ||||
-rw-r--r-- | templates/resolvconf.OpenBSD.erb | 5 | ||||
-rw-r--r-- | templates/resolvconf.erb | 11 |
3 files changed, 26 insertions, 17 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 39ddeee..97423f4 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -15,17 +15,19 @@ # modules_dir { "resolvconf": } class resolvconf { - $real_resolvconf_domain = $resolvconf_domain ? { - '' => 'rz.puzzle.ch', - default => $resolvconf_domain, + case $operatingsystem { + openbsd: { info("\$resolvconf_domain and \$resolvconf_search not needed on openbsd") } + default: { + case $resolvconf_domain { + '': { fail("you need to define \$resolvconf_domain for ${fqdn}") } + } + case $resolvconf_search { + '': { fail("you need to define \$resolvconf_search for ${fqdn}") } + } + } } - $real_resolvconf_search = $resolvconf_search ? { - '' => 'rz.puzzle.ch worldweb2000.com', - default => $resolvconf_search, - } - $real_resolvconf_nameservers = $resolvconf_nameservers ? { - '' => '195.141.101.81:195.141.101.82', - default => $resolvconf_nameservers, + case $resolvconf_nameservers { + '': { fail("you need to define \$resolvconf_nameservers for ${fqdn}") } } file { '/etc/resolv.conf': @@ -33,6 +35,9 @@ class resolvconf { owner => root, group => 0, mode => 444, - content => template("resolvconf/resolvconf.erb") + content => $operatingsystem ? { + openbsd => template("resolvconf/resolvconf.${operatingsystem}.erb"), + default => template('resolvconf/resolvconf.erb'), + } } } diff --git a/templates/resolvconf.OpenBSD.erb b/templates/resolvconf.OpenBSD.erb new file mode 100644 index 0000000..27c2a69 --- /dev/null +++ b/templates/resolvconf.OpenBSD.erb @@ -0,0 +1,5 @@ +# managed by puppet +lookup file bind +<%- resolvconf_nameservers.split(':').each do |nameserver| -%> +nameserver <%= nameserver %> +<%- end -%> diff --git a/templates/resolvconf.erb b/templates/resolvconf.erb index 0bc467f..c9a43cc 100644 --- a/templates/resolvconf.erb +++ b/templates/resolvconf.erb @@ -1,8 +1,7 @@ # managed by puppet +domain <%= resolvconf_domain %> +search <%= resolvconf_search %> -domain <%= real_resolvconf_domain %> -search <%= real_resolvconf_search %> - -<% real_resolvconf_nameservers.split(':').each do |val| -%> -nameserver <%= val %> -<% end -%> +<%- resolvconf_nameservers.split(':').each do |nameserver| -%> +nameserver <%= nameserver %> +<%- end -%> |