Hi, i want to check if the nodes are forwarding logs to a syslog server. At this moment i cant just push a new syslog.conf file to the nodes, so, i want to know if its possible to tell the nodes to parse the syslog.conf files and fail the run or something like that if a specific line is not found. Is this possible?, if it''s possible, any hint? 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.
On Wed, Nov 24, 2010 at 7:13 AM, Nicolas Arias <nicoarias@gmail.com> wrote:> Hi, i want to check if the nodes are forwarding logs to a syslog > server. At this moment i cant just push a new syslog.conf file to the > nodes, so, i want to know if its possible to tell the nodes to parse > the syslog.conf files and fail the run or something like that if a > specific line is not found. > > Is this possible?, if it''s possible, any hint?a) Use an exec resource to grep -q the relevant line. This will push the success/failure of the grep to the exit status, so the exec will fail if the line is missing. Put this in a class and make all the relevant resources require that class. or b) Push the search to the puppet pre-run command. # A command to run before every agent run. If this command returns a non-zero # return code, the entire Puppet run will fail. # The default value is ''''. # prerun_command> > > 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. > >-- Nigel Kersten - Puppet Labs - http://www.puppetlabs.com -- 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.
Thanks Nigel!!, i will give it a try later! On Wed, Nov 24, 2010 at 1:41 PM, Nigel Kersten <nigel@puppetlabs.com> wrote:> On Wed, Nov 24, 2010 at 7:13 AM, Nicolas Arias <nicoarias@gmail.com> wrote: >> Hi, i want to check if the nodes are forwarding logs to a syslog >> server. At this moment i cant just push a new syslog.conf file to the >> nodes, so, i want to know if its possible to tell the nodes to parse >> the syslog.conf files and fail the run or something like that if a >> specific line is not found. >> >> Is this possible?, if it''s possible, any hint? > > a) Use an exec resource to grep -q the relevant line. This will push > the success/failure of the grep to the exit status, so the exec will > fail if the line is missing. Put this in a class and make all the > relevant resources require that class. > > or > > b) Push the search to the puppet pre-run command. > > # A command to run before every agent run. If this command > returns a non-zero > # return code, the entire Puppet run will fail. > # The default value is ''''. > # prerun_command > > > >> >> >> 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. >> >> > > > > -- > Nigel Kersten - Puppet Labs - http://www.puppetlabs.com > > -- > 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 24 November 2010 15:13, Nicolas Arias <nicoarias@gmail.com> wrote:> > Is this possible?, if it''s possible, any hint?Custom fact that tells you where the syslog is going. Custom facts, in general, are your friend. :) -- Gary Law Email/Chat googletalk/messenger: gary.law@gmail.com iChat/jabber/AIM: gary.law@mac.com -- 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.
Nigel, Do you know if the pre and post-run commands are documented anywhere outside of the 0.25.4 release notes? I''ll file a documentation bug if I''m missing something, but I tried to look up docs this morning and didn''t find anything. I think many people would love this feature if they realized it was there. -Gary On Wed, Nov 24, 2010 at 11:41 AM, Nigel Kersten <nigel@puppetlabs.com>wrote:> On Wed, Nov 24, 2010 at 7:13 AM, Nicolas Arias <nicoarias@gmail.com> > wrote: > > Hi, i want to check if the nodes are forwarding logs to a syslog > > server. At this moment i cant just push a new syslog.conf file to the > > nodes, so, i want to know if its possible to tell the nodes to parse > > the syslog.conf files and fail the run or something like that if a > > specific line is not found. > > > > Is this possible?, if it''s possible, any hint? > > a) Use an exec resource to grep -q the relevant line. This will push > the success/failure of the grep to the exit status, so the exec will > fail if the line is missing. Put this in a class and make all the > relevant resources require that class. > > or > > b) Push the search to the puppet pre-run command. > > # A command to run before every agent run. If this command > returns a non-zero > # return code, the entire Puppet run will fail. > # The default value is ''''. > # prerun_command > > > > > > > > > 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<puppet-users%2Bunsubscribe@googlegroups.com> > . > > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > > > > > > > -- > Nigel Kersten - Puppet Labs - http://www.puppetlabs.com > > -- > 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<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- Gary Larizza Director of Technology Huron City Schools http://www.huronhs.com 悟 -- 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.
Gah, Found it on the Configration Parameter Reference here --> http://docs.puppetlabs.com/references/2.6.2/configuration.html Nevermind! On Wed, Dec 1, 2010 at 7:45 AM, Gary Larizza <gary@huron-city.k12.oh.us>wrote:> Nigel, > > Do you know if the pre and post-run commands are documented anywhere > outside of the 0.25.4 release notes? I''ll file a documentation bug if I''m > missing something, but I tried to look up docs this morning and didn''t find > anything. I think many people would love this feature if they realized it > was there. > > -Gary > > On Wed, Nov 24, 2010 at 11:41 AM, Nigel Kersten <nigel@puppetlabs.com>wrote: > >> On Wed, Nov 24, 2010 at 7:13 AM, Nicolas Arias <nicoarias@gmail.com> >> wrote: >> > Hi, i want to check if the nodes are forwarding logs to a syslog >> > server. At this moment i cant just push a new syslog.conf file to the >> > nodes, so, i want to know if its possible to tell the nodes to parse >> > the syslog.conf files and fail the run or something like that if a >> > specific line is not found. >> > >> > Is this possible?, if it''s possible, any hint? >> >> a) Use an exec resource to grep -q the relevant line. This will push >> the success/failure of the grep to the exit status, so the exec will >> fail if the line is missing. Put this in a class and make all the >> relevant resources require that class. >> >> or >> >> b) Push the search to the puppet pre-run command. >> >> # A command to run before every agent run. If this command >> returns a non-zero >> # return code, the entire Puppet run will fail. >> # The default value is ''''. >> # prerun_command >> >> >> >> > >> > >> > 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<puppet-users%2Bunsubscribe@googlegroups.com> >> . >> > For more options, visit this group at >> http://groups.google.com/group/puppet-users?hl=en. >> > >> > >> >> >> >> -- >> Nigel Kersten - Puppet Labs - http://www.puppetlabs.com >> >> -- >> 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<puppet-users%2Bunsubscribe@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.