On 06/07/15 14:26, Peter Meier wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Notify on its own is no good, since if the exec fails, the service
gets restarted anyway.
Require on its own is no good, since the exec runs every time.
Is there some way to combine the two?
The problem is that a notify includes a before relationship, which
means that the service resource is always being managed *before* the
config test happens. What you want is the following:
Hi Pete,
Thanks for your detailed response. At my site, the DHCP config is partly
written out by a Forge module, partly generated by a script from a
database and partly deployed from a git repo where it is edited by
humans. So it seems a bit messy to get all of these resources to notify
the config test and the service.
I also haven't decided whether I should run my database->dhcp config
script from an exec or via the system cron - in which case restarting
the dhcp daemon is done outside of puppet anyway.
The more I think about this, the more I think the best fix is to edit
the init script for the service. The stock init script for dhcpd on
CentOS 6 already includes a 'configtest' action so with a few lines of
code this could be executed before the service is started. This would
then trap any restarts done via cron, or via users.
It's not really the solution I wanted but I think it's probably the best
option all round.
Cheers,
Jonathan
--
You received this message because you are subscribed to the Google Groups "Puppet
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/559A85F5.3040603%40bristol.ac.uk.
For more options, visit https://groups.google.com/d/optout.