summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoram <am@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>2008-03-10 13:21:57 +0000
committeram <am@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>2008-03-10 13:21:57 +0000
commit248c5af0e05478fb7f3b38f8c4b438a88cdc105b (patch)
tree90ca5bd4f30605384a49ade12864a30b9f1f13e3
parenteb2b476b22d675c2117da4b5bddae1f07ab4eee9 (diff)
downloadpuppet-resolvconf-248c5af0e05478fb7f3b38f8c4b438a88cdc105b.tar.gz
puppet-resolvconf-248c5af0e05478fb7f3b38f8c4b438a88cdc105b.tar.bz2
umwandlung in class, und def. von variablen
git-svn-id: https://svn/ipuppet/trunk/modules/resolvconf@1057 d66ca3ae-40d7-4aa7-90d4-87d79ca94279
-rw-r--r--manifests/init.pp48
-rw-r--r--templates/resolvconf.erb8
2 files changed, 38 insertions, 18 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index e444480..58dc83f 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -4,25 +4,37 @@
# modules_dir { "resolvconf": }
-class resolvconf {}
-
-define resolvconf::create (
- $domain='glei.ch',
- $search='glei.ch',
- $nameserver1='212.103.67.60',
- $nameserver2='212.103.72.231',
- $nameserver3='192.168.1.104'
-) {
- $str = "search $search
-domain $domain
-nameserver $nameserver1
-nameserver $nameserver2
-nameserver $nameserver3
-"
-
- file { "/etc/resolv.conf":
- content => $str
+class resolvconf {
+ $real_resolvconf_domain = $resolvconf_domain ? {
+ '' => 'glei.ch',
+ default => $resolvconf_domain,
}
+ $real_resolvconf_search = $resolvconf_search ? {
+ '' => 'glei.ch',
+ default => $resolvconf_search,
+ }
+ $real_resolvconf_nameserver1 = $resolvconf_nameserver1 ? {
+ '' => '212.103.67.60',
+ default => $resolvconf_nameserver1,
+ }
+ $real_resolvconf_nameserver2 = $resolvconf_nameserver2 ? {
+ '' => '212.103.72.231',
+ default => $resolvconf_nameserver2,
+ }
+ $real_resolvconf_nameserver3 = $resolvconf_nameserver3 ? {
+ '' => '192.168.1.104',
+ default => $resolvconf_nameserver3,
+ }
+
+ file { '/etc/resolv.conf':
+ path => '/etc/resolv.conf',
+ owner => root,
+ group => 0,
+ mode => 444,
+ content => template("resolvconf/resolvconf.erb")
+ }
+
+
}
diff --git a/templates/resolvconf.erb b/templates/resolvconf.erb
new file mode 100644
index 0000000..58efe73
--- /dev/null
+++ b/templates/resolvconf.erb
@@ -0,0 +1,8 @@
+# managed by puppet
+
+domain <%= real_resolvconf_domain %>
+search <%= real_resolvconf_search %>
+nameserver1 <%= real_resolvconf_nameserver1 %>
+nameserver2 <%= real_resolvconf_nameserver2 %>
+nameserver3 <%= real_resolvconf_nameserver3 %>
+