summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-09-06 22:51:29 +0200
committermh <mh@immerda.ch>2011-09-06 22:51:29 +0200
commit5fa34ec0c8d3c996c4bf36fc685433e24a99e1d3 (patch)
tree97ba868361f1a9cc60874b30be82f3ecd35ff84b
parentd53ef6bc5c0270e88e00b225ea8d28e1584df1fa (diff)
parentb79bc742f6d93afcc2510a7f6d17175f35d907fd (diff)
downloadpuppet-resolvconf-5fa34ec0c8d3c996c4bf36fc685433e24a99e1d3.tar.gz
puppet-resolvconf-5fa34ec0c8d3c996c4bf36fc685433e24a99e1d3.tar.bz2
Merge remote-tracking branch 'puzzle/master'
-rw-r--r--manifests/init.pp43
1 files changed, 21 insertions, 22 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 77c921f..68c3eb5 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -13,29 +13,28 @@
#
class resolvconf {
- 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}") }
- }
- }
+ case $operatingsystem {
+ openbsd: {
+ info('$resolvconf_domain and $resolvconf_search not needed on openbsd')
}
- case $resolvconf_nameservers {
- '': { fail("you need to define \$resolvconf_nameservers for ${fqdn}") }
+ default: {
+ if ! $resolvconf_domain {
+ fail("you need to define \$resolvconf_domain for ${fqdn}")
+ }
+ if ! $resolvconf_search {
+ fail("you need to define \$resolvconf_search for $fqdn")
+ }
}
-
- file { '/etc/resolv.conf':
- path => '/etc/resolv.conf',
- owner => root,
- group => 0,
- mode => 444,
- content => $operatingsystem ? {
- openbsd => template("resolvconf/resolvconf.${operatingsystem}.erb"),
- default => template('resolvconf/resolvconf.erb'),
- }
+ }
+ if ! $resolvconf_nameservers {
+ fail("you need to define \$resolvconf_nameservers for $fqdn")
+ }
+ file{'/etc/resolv.conf':
+ path => '/etc/resolv.conf',
+ owner => root, group => 0, mode => 0444,
+ content => $operatingsystem ? {
+ openbsd => template("resolvconf/resolvconf.$operatingsystem.erb"),
+ default => template('resolvconf/resolvconf.erb'),
}
+ }
}