Commit 37988a6b authored by Marc Fournier's avatar Marc Fournier
Browse files

postfix: squeeze fix - replace broken exec by augeas resources.

parent 512834f0
......@@ -22,7 +22,7 @@ class postfix::mailman {
"mydestination": value => "";
"virtual_alias_maps": value => "hash:/etc/postfix/virtual";
"transport_maps": value => "hash:/etc/postfix/transport";
"mailman_destination_recipient_limit": value => "1", nonstandard => true;
"mailman_destination_recipient_limit": value => "1";
}
postfix::hash { "/etc/postfix/virtual":
......
......@@ -8,8 +8,6 @@ Parameters:
- *name*: name of the parameter.
- *ensure*: present/absent. defaults to present.
- *value*: value of the parameter.
- *nonstandard*: inform postfix::config that this parameter is not recognized
by the "postconf" command. defaults to false.
Requires:
- Class["postfix"]
......@@ -29,21 +27,25 @@ Example usage:
}
*/
define postfix::config ($ensure = present, $value, $nonstandard = false) {
case $ensure {
present: {
exec {"postconf -e ${name}='${value}'":
unless => $nonstandard ? {
false => "test \"x$(postconf -h ${name})\" == 'x${value}'",
true => "test \"x$(egrep '^${name} ' /etc/postfix/main.cf | cut -d= -f2 | cut -d' ' -f2)\" == 'x${value}'",
},
define postfix::config ($ensure = present, $value) {
Augeas {
context => "/files/etc/postfix/main.cf",
notify => Service["postfix"],
require => File["/etc/postfix/main.cf"],
}
case $ensure {
present: {
augeas { "set postfix $name to $value":
changes => "set $name $value",
}
}
absent: {
fail "postfix::config ensure => absent: Not implemented"
augeas { "set postfix $name to $value":
changes => "rm $name",
}
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment