On Wed, May 04, 2011 at 08:52:36AM -0400, Ari Constancio wrote: >Hello, > >I'm trying the example from >http://www.cfengine.org/manuals/cf3-solutions.html#Postfix-mail-configuration >. >However, /etc/postfix/sasl-passwd needs to be converted with postmap >before restarting Postfix. > >What's the proper way to deal with this? I thought of defining a new >class ("changed_sasl-passwd") if the file was successfully edited. >Then, postmap would be executed only if this class was defined: > >processes: > > "/usr/lib/postfix/master" > restart_class => "start_postfix"; > >commands: > > start_postfix.!changed_sasl-passwd:: > "/etc/init.d/postfix restart"; > > start_postfix.changed_sasl-passwd:: > "postmap $(prefix)/sasl-passwd"; > "/etc/init.d/postfix restart"; > >Unfortunately, I can't find the correct syntax to define the new class.
I think that you want to use the "classes => [...]" option. I don't think there's any harm in running postmap at each restart, so maybe try something like this (untested): bundle agent postfix { processes: "/usr/lib/postfix/master" restart_class => "start_postfix"; commands: start_postfix:: "/etc/init.d/postfix restart" classes => if_repaired('do_postmap_sasl'); do_postmap_sasl:: "/usr/sbin/postmap ${prefix}/sasl-passwd"; } > > >Thank you, >Ari Constancio >_______________________________________________ >Help-cfengine mailing list >Help-cfengine@cfengine.org >https://cfengine.org/mailman/listinfo/help-cfengine -- Jesse Becker NHGRI Linux support (Digicon Contractor) _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine