Hello all, I would like to be able to have an email sent to me if Puppet makes any changes to files, services, packages, etc. I can easily send an email with exec, but can''t see a way to do it only after a change. Is this possible? Running puppet-0.25.5-1.el5 on a mixture of CentOS and RHEL 5.4 and 5.5 Calum -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Wed, May 11, 2011 at 5:21 PM, Calum <caluml@gmail.com> wrote:> Hello all, > > I would like to be able to have an email sent to me if Puppet makes > any changes to files, services, packages, etc. > > I can easily send an email with exec, but can''t see a way to do it > only after a change. > Is this possible? > > Running puppet-0.25.5-1.el5 on a mixture of CentOS and RHEL 5.4 and > 5.5 > > > You can use tagmail report, or use something like foreman to do it for you.Ohad> Calum > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 11 May 2011 15:49, Ohad Levy <ohadlevy@gmail.com> wrote:> > You can use tagmail report, or use something like foreman to do it for you. > OhadThanks - I''ll look into those. I was more meaning something like: file { "/etc/ntp.conf": owner => root, group => root, mode => 644, source => "puppet:///modules/ntp/ntp.conf.2011-05-06", require => Package["ntp"], onchange => exec("mail ....."), } or something like that. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Silviu Paragina
2011-May-12 10:13 UTC
Re: [Puppet Users] Sending an email if an action happens
On 11.05.2011 18:06, Calum wrote:> On 11 May 2011 15:49, Ohad Levy<ohadlevy@gmail.com> wrote: >> You can use tagmail report, or use something like foreman to do it for you. >> Ohad > Thanks - I''ll look into those. > > I was more meaning something like: > > file { "/etc/ntp.conf": > owner => root, > group => root, > mode => 644, > source => "puppet:///modules/ntp/ntp.conf.2011-05-06", > require => Package["ntp"], > onchange => exec("mail ....."), > } > > or something like that. >You almost gave yourself the answer. :) Check the refreshonly parameter for the exec type ;) But this seems more of a hack to me, so take it as you wish. Silviu -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Thu, May 12, 2011 at 5:13 AM, Silviu Paragina <silviu@paragina.ro> wrote:> On 11.05.2011 18:06, Calum wrote: >> >> On 11 May 2011 15:49, Ohad Levy<ohadlevy@gmail.com> wrote: >>> >>> You can use tagmail report, or use something like foreman to do it for >>> you. >>> Ohad >> >> Thanks - I''ll look into those. >> >> I was more meaning something like: >> >> file { "/etc/ntp.conf": >> owner => root, >> group => root, >> mode => 644, >> source => "puppet:///modules/ntp/ntp.conf.2011-05-06", >> require => Package["ntp"], >> onchange => exec("mail ....."), >> } >> >> or something like that. >> > You almost gave yourself the answer. :) Check the refreshonly parameter for > the exec type ;) > But this seems more of a hack to me, so take it as you wish. >Back to Ohad''s recommendation. If you have several resources that you need to receive email alerts upon resource changes, use tagmail report functionality. 1. Add the metaparameter tag => send_me_email (or any arbitrary set of tag values) to the resource you want to monitor via email. 2. Enable reports = tagmail in puppet.conf [master] section, 3. In in tagmap conf set tag and email address: send_me_email: admin@... Thanks, Nan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 12 May 2011 11:13, Silviu Paragina <silviu@paragina.ro> wrote:> You almost gave yourself the answer. :) Check the refreshonly parameter for > the exec type ;)Perfect. Just what I wanted. The reporting looked too much for what we wanted, for now, anyway. Many thanks. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
jcbollinger
2011-May-12 13:19 UTC
[Puppet Users] Re: Sending an email if an action happens
On May 12, 5:13 am, Silviu Paragina <sil...@paragina.ro> wrote:> On 11.05.2011 18:06, Calum wrote: > > > > > On 11 May 2011 15:49, Ohad Levy<ohadl...@gmail.com> wrote: > >> You can use tagmail report, or use something like foreman to do it for you. > >> Ohad > > Thanks - I''ll look into those. > > > I was more meaning something like: > > > file { "/etc/ntp.conf": > > owner => root, > > group => root, > > mode => 644, > > source => "puppet:///modules/ntp/ntp.conf.2011-05-06", > > require => Package["ntp"], > > onchange => exec("mail ....."), > > } > > > or something like that. > > You almost gave yourself the answer. :) Check the refreshonly parameter > for the exec type ;) > But this seems more of a hack to me, so take it as you wish.To be clear, to do it this way, "onchange" should be spelled "notify", and the Exec should be declared with refreshonly => true. It doesn''t seem very hackish to me, but tagmail would be a better solution for most purposes. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Ohad Levy
2011-May-12 13:22 UTC
Re: [Puppet Users] Re: Sending an email if an action happens
On Thu, May 12, 2011 at 4:19 PM, jcbollinger <John.Bollinger@stjude.org>wrote:> > > On May 12, 5:13 am, Silviu Paragina <sil...@paragina.ro> wrote: > > On 11.05.2011 18:06, Calum wrote: > > > > > > > > > On 11 May 2011 15:49, Ohad Levy<ohadl...@gmail.com> wrote: > > >> You can use tagmail report, or use something like foreman to do it for > you. > > >> Ohad > > > Thanks - I''ll look into those. > > > > > I was more meaning something like: > > > > > file { "/etc/ntp.conf": > > > owner => root, > > > group => root, > > > mode => 644, > > > source => > "puppet:///modules/ntp/ntp.conf.2011-05-06", > > > require => Package["ntp"], > > > onchange => exec("mail ....."), > > > } > > > > > or something like that. > > > > You almost gave yourself the answer. :) Check the refreshonly parameter > > for the exec type ;) > > But this seems more of a hack to me, so take it as you wish. > > > To be clear, to do it this way, "onchange" should be spelled "notify", > and the Exec should be declared with refreshonly => true. It doesn''t > seem very hackish to me, but tagmail would be a better solution for > most purposes.the problem with tagmail is that you get every email (that was tagged for) regardless of environment, host owner etc. Ohad -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.