Permalink
Browse files

(module mailman) allow puppet to configure list option

  • Loading branch information...
1 parent 1340387 commit 17be2655fa7017812a559c78978f4da8b3fa98c1 @cjeanneret cjeanneret committed Nov 18, 2010
Showing with 17 additions and 0 deletions.
  1. +14 −0 manifests/definitions/mailman-config.pp
  2. +3 −0 templates/config_list.erb
@@ -0,0 +1,14 @@
+define mailman::config($ensure=present, $variable, $value, $mlist) {
+ common::concatfilepart {$name:
+ ensure => $ensure,
+ file => "/var/lib/mailman/lists/${mlist}/puppet-config.conf",
+ content => template("mailman/config_list.erb"),
+ notify => Exec["load configuration $variable on $mlist"],
+ require => [Class["mailman"], Maillist[$mlist]],
+ }
+ exec {"load configuration $variable on $mlist":
+ refreshonly => true,
+ command => "config_list -i /var/lib/mailman/lists/${mlist}/puppet-config.conf $mlist",
+ onlyif => "config_list -i /var/lib/mailman/lists/${mlist}/puppet-config.conf -c $mlist"
+ }
+}
@@ -0,0 +1,3 @@
+# file managed by puppet
+# <%=name%> for <%=mlist%>
+<%=variable%> = <%=value%>

0 comments on commit 17be265

Please sign in to comment.