From 28df18c79fb71407af663ee9b3c214094e1551f1 Mon Sep 17 00:00:00 2001 From: Marc Fournier Date: Wed, 3 Dec 2008 17:53:28 +0100 Subject: Initial import from bzr into github. --- manifests/definitions/config.pp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 manifests/definitions/config.pp (limited to 'manifests/definitions/config.pp') diff --git a/manifests/definitions/config.pp b/manifests/definitions/config.pp new file mode 100644 index 0000000..ec6c782 --- /dev/null +++ b/manifests/definitions/config.pp @@ -0,0 +1,18 @@ +define postfix-ng::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}'", + }, + notify => Service["postfix"], + require => File["/etc/postfix/main.cf"], + } + } + + absent: { + fail "postfix-ng::config ensure => absent: Not implemented" + } + } +} -- cgit v1.2.3