throw away the defaulting immerda specific variables, added a special template for...
authormh <mh@immerda.ch>
Mon, 6 Oct 2008 21:19:04 +0000 (21:19 +0000)
committermh <mh@immerda.ch>
Mon, 6 Oct 2008 21:19:04 +0000 (21:19 +0000)
manifests/init.pp
templates/resolvconf.OpenBSD.erb [new file with mode: 0644]
templates/resolvconf.erb

index 1f5f986..a14f01b 100644 (file)
 # modules_dir { "resolvconf": }
 
 class resolvconf {
-    $real_resolvconf_domain = $resolvconf_domain ? {
-        ''  => 'glei.ch',
-        default => $resolvconf_domain,
+    case $reseolvconf_domain {
+        '': { fail("you need to define \$reseolvconf_domain for ${fqdn}") }
     }
-    $real_resolvconf_search = $resolvconf_search ? {
-        ''  => 'glei.ch',
-        default => $resolvconf_search,
+    $resolvconf_search {
+        '': { fail("you need to define \$reseolvconf_search for ${fqdn}") }
     }
-    $real_resolvconf_nameservers = $resolvconf_nameservers ? {
-        ''  => '212.103.67.60:212.103.67.61',
-        default => $resolvconf_nameservers,
+    $resolvconf_nameservers {
+        '': { fail("you need to define \$reseolvconf_nameservers for ${fqdn}") }
     }
 
     file { '/etc/resolv.conf':
@@ -33,6 +30,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 (file)
index 0000000..945284e
--- /dev/null
@@ -0,0 +1,5 @@
+# managed by puppet
+lookup file bind
+<% resolvconf_nameservers.split(':').each do |nameserver| -%> 
+nameserver <%= nameserver %> 
+<% end -%>
index 0bc467f..f2c17a6 100644 (file)
@@ -1,8 +1,8 @@
 # managed by puppet
 
-domain <%= real_resolvconf_domain %>
-search <%= real_resolvconf_search %>
+domain <%= resolvconf_domain %>
+search <%= resolvconf_search %>
 
-<% real_resolvconf_nameservers.split(':').each do |val| -%> 
-nameserver <%= val %> 
+<% resolvconf_nameservers.split(':').each do |nameserver| -%> 
+nameserver <%= nameserver %> 
 <% end -%>