diff options
author | mh <mh@immerda.ch> | 2012-02-16 16:51:56 +0100 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2012-04-07 13:56:47 -0300 |
commit | 59010a1c304801db6423f67d656399478fc603f0 (patch) | |
tree | 2ff29f6c26451f2dd62f53a3a5abb5b09bef7ab4 /manifests/definitions/config.pp | |
parent | 462db65ec48b6398c9a04a88cc4c197eb73f34fa (diff) | |
download | puppet-postfix-59010a1c304801db6423f67d656399478fc603f0.tar.gz puppet-postfix-59010a1c304801db6423f67d656399478fc603f0.tar.bz2 |
put classes and defines in the proper place
To take advantage of puppet's autoloading feature, which will be
mandatory sooner or later. We move all the files in their appropriate
place.
Diffstat (limited to 'manifests/definitions/config.pp')
-rw-r--r-- | manifests/definitions/config.pp | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/manifests/definitions/config.pp b/manifests/definitions/config.pp deleted file mode 100644 index 8e203a6..0000000 --- a/manifests/definitions/config.pp +++ /dev/null @@ -1,49 +0,0 @@ -/* -== Definition: postfix::config - -Uses the "postconf" command to add/alter/remove options in postfix main -configuation file (/etc/postfix/main.cf). - -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"] - -Example usage: - - node "toto.example.com" { - - include postfix - - postfix::config { - "smtp_use_tls" => "yes"; - "smtp_sasl_auth_enable" => "yes"; - "smtp_sasl_password_maps" => "hash:/etc/postfix/my_sasl_passwords"; - "relayhost" => "[mail.example.com]:587"; - } - } - -*/ -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}'", - }, - notify => Service["postfix"], - require => File["/etc/postfix/main.cf"], - } - } - - absent: { - fail "postfix::config ensure => absent: Not implemented" - } - } -} |