From c04dbbf3b916ca0f4271d4c6cb06f37cb3e5959c Mon Sep 17 00:00:00 2001 From: Simon Josi Date: Wed, 24 Feb 2010 11:32:04 +0100 Subject: cleanup --- manifests/init.pp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 77c921f..94d2a51 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -14,27 +14,26 @@ class resolvconf { case $operatingsystem { - openbsd: { info("\$resolvconf_domain and \$resolvconf_search not needed on openbsd") } + openbsd: { + info('$resolvconf_domain and $resolvconf_search not needed on openbsd') + } default: { - case $resolvconf_domain { - '': { fail("you need to define \$resolvconf_domain for ${fqdn}") } + if ! $resolvconf_domain { + fail("you need to define \$resolvconf_domain for ${fqdn}") } - case $resolvconf_search { - '': { fail("you need to define \$resolvconf_search for ${fqdn}") } + if ! $resolvconf_search { + fail("you need to define \$resolvconf_search for $fqdn") } } } - case $resolvconf_nameservers { - '': { fail("you need to define \$resolvconf_nameservers for ${fqdn}") } + if ! $resolvconf_nameservers { + fail("you need to define \$resolvconf_nameservers for $fqdn") } - - file { '/etc/resolv.conf': + file{'/etc/resolv.conf': path => '/etc/resolv.conf', - owner => root, - group => 0, - mode => 444, + owner => root, group => 0, mode => 0444, content => $operatingsystem ? { - openbsd => template("resolvconf/resolvconf.${operatingsystem}.erb"), + openbsd => template("resolvconf/resolvconf.$operatingsystem.erb"), default => template('resolvconf/resolvconf.erb'), } } -- cgit v1.2.3 From b79bc742f6d93afcc2510a7f6d17175f35d907fd Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 21 Sep 2010 18:20:00 +0200 Subject: refactor module to the new standard --- manifests/init.pp | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 94d2a51..68c3eb5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -13,28 +13,28 @@ # class resolvconf { - case $operatingsystem { - openbsd: { - info('$resolvconf_domain and $resolvconf_search not needed on openbsd') - } - 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") - } - } + case $operatingsystem { + openbsd: { + info('$resolvconf_domain and $resolvconf_search not needed on openbsd') } - if ! $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 => 0444, - 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'), } + } } -- cgit v1.2.3