Thanks for this, the snippet below worked great, with a couple of minor
changes, on my CentOS 5 system:
- full path to /usr/bin/test
- single equal in 'false' test
Thanks Francois!
Regards
Darryl
Francois Deppierraz wrote:
> Darryl Ross wrote:
>
>> What is the recommended way of managing something like the postfix
>> configuration file? I would prefer _not_ to overwrite the config file with
>> one
>> stored centrally or using the templating system.
>>
>> Ideally I'd like to use the 'postconf' and 'postconf -e' programs to get and
>> set options.
>
> Yes, that's what we are using.
>
> 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"
> }
> }
> }
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---