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 { ...@@ -22,7 +22,7 @@ class postfix::mailman {
"mydestination": value => ""; "mydestination": value => "";
"virtual_alias_maps": value => "hash:/etc/postfix/virtual"; "virtual_alias_maps": value => "hash:/etc/postfix/virtual";
"transport_maps": value => "hash:/etc/postfix/transport"; "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": postfix::hash { "/etc/postfix/virtual":
......
...@@ -8,8 +8,6 @@ Parameters: ...@@ -8,8 +8,6 @@ Parameters:
- *name*: name of the parameter. - *name*: name of the parameter.
- *ensure*: present/absent. defaults to present. - *ensure*: present/absent. defaults to present.
- *value*: value of the parameter. - *value*: value of the parameter.
- *nonstandard*: inform postfix::config that this parameter is not recognized
by the "postconf" command. defaults to false.
Requires: Requires:
- Class["postfix"] - Class["postfix"]
...@@ -29,21 +27,25 @@ Example usage: ...@@ -29,21 +27,25 @@ Example usage:
} }
*/ */
define postfix::config ($ensure = present, $value, $nonstandard = false) { define postfix::config ($ensure = present, $value) {
Augeas {
context => "/files/etc/postfix/main.cf",
notify => Service["postfix"],
require => File["/etc/postfix/main.cf"],
}
case $ensure { case $ensure {
present: { present: {
exec {"postconf -e ${name}='${value}'": augeas { "set postfix $name to $value":
unless => $nonstandard ? { changes => "set $name $value",
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}'",
},
notify => Service["postfix"],
require => File["/etc/postfix/main.cf"],
} }
} }
absent: { 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