Puppeteers, I''ve seen things in the documentation to make me think this is possible but I''m not sure how to implement it. Here''s what I''d like to do: puppetd pulls down a config file, say httpd.conf BEFORE puppetd moves it to $path, I''d like to have it check it''s integrity with apachectl configtest IF configtest passes, then puppetd should move httpd.conf to $path and bounce the server. ELSE puppetd should not move httpd.conf to $path and it should notify me of an error If somebody''s already implemented this procedure, I''d love to see a snippet TIA, Jeff --~--~---------~--~----~------------~-------~--~----~ 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> If somebody''s already implemented this procedure, I''d love to see a > snippetnot testes, just hacking right out of my mind: file{"$tmppath/httpd.conf": source => "$location", notify => Exec[ccopy_http.conf], } exec{''copy_http.conf'': command => "cp $tmppath/httpd.conf $realapacheconfig", refreshonly => true, onlyif => "apachectl checkconfig $tmppath/httpd.conf", notify => Service[apache], } service{apache: ensure => running, } if apachectl will fail, then puppetrun will fail and then you can configure in puppet some reports, which will inform you if manifests have failed or not. I think this should more or less fit your needs. greets pete --~--~---------~--~----~------------~-------~--~----~ 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 May 15, 12:01 pm, Peter Meier <peter.me...@immerda.ch> wrote:> Hi > > > If somebody''s already implemented this procedure, I''d love to see a > > snippet > > not testes, just hacking right out of my mind: > > file{"$tmppath/httpd.conf": > source => "$location", > notify => Exec[ccopy_http.conf], > > } > > exec{''copy_http.conf'': > command => "cp $tmppath/httpd.conf $realapacheconfig", > refreshonly => true, > onlyif => "apachectl checkconfig $tmppath/httpd.conf", > notify => Service[apache], > > } > > service{apache: > ensure => running, > > } > > if apachectl will fail, then puppetrun will fail and then you can > configure in puppet some reports, which will inform you if manifests > have failed or not. > > I think this should more or less fit your needs. >Thanks, Pete. I''ll give it a try. It looks promising... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---