Hi list, I am setting up tagmail. I have it working fine for loglevel tags such as "all" and "err" and "notice". puppetmaster send email, and I recieve them. all good. but when I setup tagmail for user defined tags no email is sent. (I varified by checking postfix logs on the puppetmaster server.) master and agents are version 2.6.4 # /etc/puppet/tagmail.conf: #all: agould@ucop.edu #err: agould@ucop.edu #notice: agould@ucop.edu connected: agould@ucop.edu # manifest that sets my tag: class centrify { notice("adinfo_mode is ''$::adinfo_mode''") if $::adinfo_mode == "connected" { tag("connected") } package { "CentrifyDC": ensure => present, provider => zypper, } } # puppetmaster log sees the notice: Jan 6 17:39:41 unxpupp01 puppet-master[9541]: (Scope(Class[Centrify])) adinfo_mode is ''connected'' Jan 6 17:39:41 unxpupp01 puppet-master[9541]: Compiled catalog for sl11lab01-vhost.ucop.edu in environment dev_ashley in 0.39 seconds # Stored yaml report shows tag got set: unxpupp01:/logs/puppet/reports/sl11lab01-vhost.ucop.edu # grep -B10 connected 201201070139.yaml file: /data/puppet/dev_ashley/modules/centrify/manifests/init.pp line: 26 resource: "Package[CentrifyDC]" source_description: "/Stage[main]/Centrify/Package[CentrifyDC]" tags: - package - centrifydc - class - centrify - node - sl11lab01-vhost - connected Any ideas what is missing? -- -ashley Did you try poking at it with a stick? -- 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.
I have found a work around, but I would still like to understand what is correct behavior. I used the notify resource instead of tag metaparam: if $::adinfo_mode == "disconnected" { notify { "disconnected": message => "AD client in disconnected state", } } This creats a "logs" object in the report which can then be accessed by tagmail: logs: - !ruby/object:Puppet::Util::Log level: !ruby/sym notice message: &id010 AD client in disconnected state source: Puppet tags: - notice time: 2012-01-10 03:58:15.641172 -08:00 version: 2.6.4 - !ruby/object:Puppet::Util::Log file: &id002 /data/puppet/production/modules/centrify/manifests/init.pp level: !ruby/sym notice line: 87 message: &id011 defined ''message'' as ''AD client in disconnected state'' source: &id012 "/Stage[main]/Centrify/Notify[disconnected]/message" tags: - notice - notify - disconnected - class - centrify - suse_base - common::suse - common - suse - node - default time: 2012-01-10 03:58:15.641953 -08:00 Clearly this does not correspond to any tagmail documentation, and it seems a round-about way to configure things. Is this a recommended approach? On Fri, Jan 06, 2012 at 05:45:42PM -0800, Ashley Gould wrote:> Hi list, > > I am setting up tagmail. I have it working fine for loglevel tags such > as "all" and "err" and "notice". puppetmaster send email, and I recieve > them. all good. > > but when I setup tagmail for user defined tags no email is sent. (I > varified by checking postfix logs on the puppetmaster server.) > > master and agents are version 2.6.4 > > > # /etc/puppet/tagmail.conf: > > #all: agould@ucop.edu > #err: agould@ucop.edu > #notice: agould@ucop.edu > connected: agould@ucop.edu > > > > # manifest that sets my tag: > > class centrify { > > notice("adinfo_mode is ''$::adinfo_mode''") > > if $::adinfo_mode == "connected" { > tag("connected") > } > > package { "CentrifyDC": > ensure => present, > provider => zypper, > } > > } > > > # puppetmaster log sees the notice: > > Jan 6 17:39:41 unxpupp01 puppet-master[9541]: (Scope(Class[Centrify])) adinfo_mode is ''connected'' > Jan 6 17:39:41 unxpupp01 puppet-master[9541]: Compiled catalog for sl11lab01-vhost.ucop.edu in environment dev_ashley in 0.39 seconds > > > # Stored yaml report shows tag got set: > > unxpupp01:/logs/puppet/reports/sl11lab01-vhost.ucop.edu # grep -B10 connected 201201070139.yaml > file: /data/puppet/dev_ashley/modules/centrify/manifests/init.pp > line: 26 > resource: "Package[CentrifyDC]" > source_description: "/Stage[main]/Centrify/Package[CentrifyDC]" > tags: > - package > - centrifydc > - class > - centrify > - node > - sl11lab01-vhost > - connected > > > Any ideas what is missing? > > > > > > -- > > -ashley > > Did you try poking at it with a stick?-- -ashley Did you try poking at it with a stick? -- 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.
See below: On Tue, Jan 10, 2012 at 2:18 PM, Ashley Gould <agould@ucop.edu> wrote:> I have found a work around, but I would still like to understand what > is correct behavior.Not sure what you mean, the only clarification is the notify resource will always result in a changed resource, guarantee you get transaction report with that tag on every single puppet run, While a regular tag resource will trigger tagmail only if there are changes/failure to that resource (or in another word the resource is not in desired state). If the tagged resource changed and tagmail didn''t generate a report, I would consider it a bug.> I used the notify resource instead of tag metaparam: > > if $::adinfo_mode == "disconnected" { > notify { "disconnected": > message => "AD client in disconnected state", > } > }As long you are ok with this resulting in a changed resource on every puppet run.> This creats a "logs" object in the report which can then be accessed by > tagmail: > > logs: > - !ruby/object:Puppet::Util::Log > level: !ruby/sym notice > message: &id010 AD client in disconnected state > source: Puppet > tags: > - notice > time: 2012-01-10 03:58:15.641172 -08:00 > version: 2.6.4 > - !ruby/object:Puppet::Util::Log > file: &id002 /data/puppet/production/modules/centrify/manifests/init.pp > level: !ruby/sym notice > line: 87 > message: &id011 defined ''message'' as ''AD client in disconnected state'' > source: &id012 "/Stage[main]/Centrify/Notify[disconnected]/message" > tags: > - notice > - notify > - disconnected > - class > - centrify > - suse_base > - common::suse > - common > - suse > - node > - default > time: 2012-01-10 03:58:15.641953 -08:00 > > > > Clearly this does not correspond to any tagmail documentation, and it seems > a round-about way to configure things. Is this a recommended approach? > > > > On Fri, Jan 06, 2012 at 05:45:42PM -0800, Ashley Gould wrote: >> Hi list, >> >> I am setting up tagmail. I have it working fine for loglevel tags such >> as "all" and "err" and "notice". puppetmaster send email, and I recieve >> them. all good. >> >> but when I setup tagmail for user defined tags no email is sent. (I >> varified by checking postfix logs on the puppetmaster server.) >> >> master and agents are version 2.6.4 >> >> >> # /etc/puppet/tagmail.conf: >> >> #all: agould@ucop.edu >> #err: agould@ucop.edu >> #notice: agould@ucop.edu >> connected: agould@ucop.edu >> >> >> >> # manifest that sets my tag: >> >> class centrify { >> >> notice("adinfo_mode is ''$::adinfo_mode''") >> >> if $::adinfo_mode == "connected" { >> tag("connected") >> } >> >> package { "CentrifyDC": >> ensure => present, >> provider => zypper, >> } >> >> } >> >> >> # puppetmaster log sees the notice: >> >> Jan 6 17:39:41 unxpupp01 puppet-master[9541]: (Scope(Class[Centrify])) adinfo_mode is ''connected'' >> Jan 6 17:39:41 unxpupp01 puppet-master[9541]: Compiled catalog for sl11lab01-vhost.ucop.edu in environment dev_ashley in 0.39 seconds >> >> >> # Stored yaml report shows tag got set: >> >> unxpupp01:/logs/puppet/reports/sl11lab01-vhost.ucop.edu # grep -B10 connected 201201070139.yaml >> file: /data/puppet/dev_ashley/modules/centrify/manifests/init.pp >> line: 26 >> resource: "Package[CentrifyDC]" >> source_description: "/Stage[main]/Centrify/Package[CentrifyDC]" >> tags: >> - package >> - centrifydc >> - class >> - centrify >> - node >> - sl11lab01-vhost >> - connectedIn this partial output log, I don''t see the resource changed, so I don''t think it should trigger tagmail. Here''s an example a package resource that changed during a puppet run (key difference Puppet::Transaction::Event): - !ruby/object:Puppet::Util::Log file: &id002 /tmp/httpd.pp level: !ruby/sym notice line: 3 message: &id001 created source: "/Stage[main]//Package[httpd]/ensure" tags: - notice - package - httpd - class ... - !ruby/object:Puppet::Transaction::Event audited: false desired_value: !ruby/sym present historical_value: message: *id001 name: !ruby/sym package_installed previous_value: !ruby/sym absent property: ensure status: success 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.
Hi Nan, On Tue, Jan 10, 2012 at 11:56:20PM -0600, Nan Liu wrote:> See below: > > On Tue, Jan 10, 2012 at 2:18 PM, Ashley Gould <agould@ucop.edu> wrote: > > I have found a work around, but I would still like to understand what > > is correct behavior. > > Not sure what you mean, the only clarification is the notify resource > will always result in a changed resource, guarantee you get > transaction report with that tag on every single puppet run, While a > regular tag resource will trigger tagmail only if there are > changes/failure to that resource (or in another word the resource is > not in desired state). If the tagged resource changed and tagmail > didn''t generate a report, I would consider it a bug. >This helps my understanding a lot. thanks. There is no bug. I was using tags wrong. I was trying to get tagmail to warn us whenever the adinfo_mode fact returns "disconnected" using an if statement. No resourse was being changed.> > I used the notify resource instead of tag metaparam: > > > > if $::adinfo_mode == "disconnected" { > > notify { "disconnected": > > message => "AD client in disconnected state", > > } > > } > > As long you are ok with this resulting in a changed resource on every > puppet run. >In this pariticular case the notify resource is appropriate, since all I want is warning of an error state. I am in process of writing a class to repair the error. I will play with tags in that context.> > This creats a "logs" object in the report which can then be accessed by > > tagmail: > > > > logs: > > - !ruby/object:Puppet::Util::Log > > level: !ruby/sym notice > > message: &id010 AD client in disconnected state > > source: Puppet > > tags: > > - notice > > time: 2012-01-10 03:58:15.641172 -08:00 > > version: 2.6.4 > > - !ruby/object:Puppet::Util::Log > > file: &id002 /data/puppet/production/modules/centrify/manifests/init.pp > > level: !ruby/sym notice > > line: 87 > > message: &id011 defined ''message'' as ''AD client in disconnected state'' > > source: &id012 "/Stage[main]/Centrify/Notify[disconnected]/message" > > tags: > > - notice > > - notify > > - disconnected > > - class > > - centrify > > - suse_base > > - common::suse > > - common > > - suse > > - node > > - default > > time: 2012-01-10 03:58:15.641953 -08:00 > > > > > > > > Clearly this does not correspond to any tagmail documentation, and it seems > > a round-about way to configure things. Is this a recommended approach? > > > > > > > > On Fri, Jan 06, 2012 at 05:45:42PM -0800, Ashley Gould wrote: > >> Hi list, > >> > >> I am setting up tagmail. I have it working fine for loglevel tags such > >> as "all" and "err" and "notice". puppetmaster send email, and I recieve > >> them. all good. > >> > >> but when I setup tagmail for user defined tags no email is sent. (I > >> varified by checking postfix logs on the puppetmaster server.) > >> > >> master and agents are version 2.6.4 > >> > >> > >> # /etc/puppet/tagmail.conf: > >> > >> #all: agould@ucop.edu > >> #err: agould@ucop.edu > >> #notice: agould@ucop.edu > >> connected: agould@ucop.edu > >> > >> > >> > >> # manifest that sets my tag: > >> > >> class centrify { > >> > >> notice("adinfo_mode is ''$::adinfo_mode''") > >> > >> if $::adinfo_mode == "connected" { > >> tag("connected") > >> } > >> > >> package { "CentrifyDC": > >> ensure => present, > >> provider => zypper, > >> } > >> > >> } > >> > >> > >> # puppetmaster log sees the notice: > >> > >> Jan 6 17:39:41 unxpupp01 puppet-master[9541]: (Scope(Class[Centrify])) adinfo_mode is ''connected'' > >> Jan 6 17:39:41 unxpupp01 puppet-master[9541]: Compiled catalog for sl11lab01-vhost.ucop.edu in environment dev_ashley in 0.39 seconds > >> > >> > >> # Stored yaml report shows tag got set: > >> > >> unxpupp01:/logs/puppet/reports/sl11lab01-vhost.ucop.edu # grep -B10 connected 201201070139.yaml > >> file: /data/puppet/dev_ashley/modules/centrify/manifests/init.pp > >> line: 26 > >> resource: "Package[CentrifyDC]" > >> source_description: "/Stage[main]/Centrify/Package[CentrifyDC]" > >> tags: > >> - package > >> - centrifydc > >> - class > >> - centrify > >> - node > >> - sl11lab01-vhost > >> - connected > > In this partial output log, I don''t see the resource changed, so I > don''t think it should trigger tagmail. Here''s an example a package > resource that changed during a puppet run (key difference > Puppet::Transaction::Event): > > - !ruby/object:Puppet::Util::Log > file: &id002 /tmp/httpd.pp > level: !ruby/sym notice > line: 3 > message: &id001 created > source: "/Stage[main]//Package[httpd]/ensure" > tags: > - notice > - package > - httpd > - class > ... > - !ruby/object:Puppet::Transaction::Event > audited: false > desired_value: !ruby/sym present > historical_value: > message: *id001 > name: !ruby/sym package_installed > previous_value: !ruby/sym absent > property: ensure > status: success > > Thanks, > > Nan-- -ashley Did you try poking at it with a stick? -- 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.