This is a sort of open-ended question, to find out if the concept is possible or has been done... I have used cfengine in the past to do assisted autorecovery of systems, by integrating Hobbit paging with cfrun. In those cases, I''ve added classes to cfengine rules to use dynamically-defined classes as "hints" to cfengine that a problem exists, and to run appropriate recovery actions (like force-restarting a service). Is such a concept feasible with Puppet, and with puppetrun? I''m not sure how I could pass something (a fact?) through puppetrun and trigger some action on a puppet instance on a remote host. Interested in any comments, experience, or thoughts anyone has on this. Thanks in advance. -Alan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
2008/11/24 Alan Sparks <asparks@doublesparks.net>> > This is a sort of open-ended question, to find out if the concept is > possible or has been done... > > I have used cfengine in the past to do assisted autorecovery of systems, > by integrating Hobbit paging with cfrun. In those cases, I''ve added > classes to cfengine rules to use dynamically-defined classes as "hints" > to cfengine that a problem exists, and to run appropriate recovery > actions (like force-restarting a service). > > Is such a concept feasible with Puppet, and with puppetrun? I''m not > sure how I could pass something (a fact?) through puppetrun and trigger > some action on a puppet instance on a remote host. > > Interested in any comments, experience, or thoughts anyone has on this. > Thanks in advance. > -Alan > >You could do this a number of ways. puppetrun allows you to just specify the ''tag'' you want to run. Every class also creates a tag of the same name, so for instance lets say apache croaks for whatever reason, and you have a class for apache that says the service aught to be running, you''d just do "puppetrun -t apache" and presto. There are a couple of other options for puppetrun you might find useful, I suggest you take a glance at that manual page for it, some useful examples in there too. .r'' --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Are there any examples of how something like this would work? Can''t seem to grasp it from documentation, how I could creat a tag like "apache_broken" and apply that to something that would force a restart of the service. The issue is, "ensure" is not adequate, since the service could appear to be running but is actually failing... Thanks for the hint. -Alan RijilV wrote:> > > 2008/11/24 Alan Sparks <asparks@doublesparks.net > <mailto:asparks@doublesparks.net>> > > > This is a sort of open-ended question, to find out if the concept is > possible or has been done... > > I have used cfengine in the past to do assisted autorecovery of > systems, > by integrating Hobbit paging with cfrun. In those cases, I''ve added > classes to cfengine rules to use dynamically-defined classes as > "hints" > to cfengine that a problem exists, and to run appropriate recovery > actions (like force-restarting a service). > > Is such a concept feasible with Puppet, and with puppetrun? I''m not > sure how I could pass something (a fact?) through puppetrun and > trigger > some action on a puppet instance on a remote host. > > Interested in any comments, experience, or thoughts anyone has on > this. > Thanks in advance. > -Alan > > > You could do this a number of ways. puppetrun allows you to just > specify the ''tag'' you want to run. Every class also creates a tag of > the same name, so for instance lets say apache croaks for whatever > reason, and you have a class for apache that says the service aught to > be running, you''d just do "puppetrun -t apache" and presto. > > > There are a couple of other options for puppetrun you might find > useful, I suggest you take a glance at that manual page for it, some > useful examples in there too. > > > .r'' > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
2008/11/24 Alan Sparks <asparks@doublesparks.net>> > Are there any examples of how something like this would work? Can''t > seem to grasp it from documentation, how I could creat a tag like > "apache_broken" and apply that to something that would force a restart > of the service. The issue is, "ensure" is not adequate, since the > service could appear to be running but is actually failing... > Thanks for the hint. > -Alan >There are a couple of things you could do here. If your service appears to be running but isn''t, you might just want to write an init script that does a better job of determing the status. You could also specify a command to run to verify status with the ''status'' option[1] for the service type, eg you could run whatever check your monitoring system runs locally. Failing that, you could do something like this: class apache { # do your normal apache things # including starting the service: service { "apache": ensure => ''running'' } } class apache::forcerestart inherits apache { exec { "killall -9 httpd": before => Service["apache"], } } then from puppetrun you could just do: puppetrun -t apache::forcerestart <host where apache is not running correctly> If there were any other common fixes for why the service might all of the sudden stop working you could impliment them in the apache::forcerestart class. .r'' [1]: http://reductivelabs.com/trac/puppet/wiki/TypeReference#service --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---