One idea is that instead of puppet on an agent doing something, it might make sense to have something watch puppetDB contents for the success of applying the class/package/file resources in question. As long as they are idempotent then it would only trigger once. I don't delve into puppetDB directly much, so sorry for the vagueness in this suggestion.
I assume this is something assigned during provisioning or when a feature flag is flipped. If so, you could also put the notification element there - notify the end user if success, notify the provisioning team if failure. Finally, if you do resort to an exec, you can set refreshonly to true and notify it from the dependent resources. There's still no guarantee this only happens once, for instance if someone modifies the package resource by hand and puppet reverts it, but that's kind of outside puppet's scope anyway. The exec itself would still only fire based on the business rules you codify in your puppet code. Lots of ways to tackle this one. On Tue, Jun 6, 2017 at 9:04 AM Lars Van Steenbergen <l...@larsenbritt.be> wrote: > I'm in the situation where i need puppet to send a mail to a team when a > certain puppet module is in place (package and config files) so another > team can do its magic. > What is the best way to send a mail containing hostname and ip to this > team when the first run was successful? > It may only be send once. > > I know i can solve this with an exec but someone once told me to try to > avoid the use of exec. > So is there a better solution for this? > > Kind regards > > -- > 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/dab80c4f-3aa6-4605-8120-02385fe3bdde%40googlegroups.com > <https://groups.google.com/d/msgid/puppet-users/dab80c4f-3aa6-4605-8120-02385fe3bdde%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Rob Nelson -- 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/CAC76iT-BKDXgeeOtRVNimUO0Kztn6WrkfCYuTVdUe3APVmMNtA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.