refactor module to the new standard
authorMarcel Haerry <haerry@puzzle.ch>
Tue, 21 Sep 2010 16:20:00 +0000 (18:20 +0200)
committerMarcel Haerry <haerry@puzzle.ch>
Tue, 21 Sep 2010 16:20:00 +0000 (18:20 +0200)
manifests/init.pp

index 94d2a51..68c3eb5 100644 (file)
 #
 
 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'),
     }
+  }
 }