On Oct 20, 11:59 pm, Luke Kanies <l...@madstop.com> wrote: > On Oct 19, 2009, at 7:56 AM, LdvT wrote: > > > > > I wouldn't mind having failure detection. > > > Say somehow a bad copy of a .conf file is distributed; and the service > > fails to start. > > If that can be detected and used as a condition, puppet could than > > call up another manifest to drop in a default/backup copy of the .conf > > file and restart the service almost immediately. > > Toss in a notify function on that manifest, and it would be a very > > handy feature for making changes on diverse production systems. > > My goal has always been to support this, but I've never quite gotten > there, and it's never seemed to matter enough to people that. > > At the least, you need every resource to be reversible (including > execs), and you need a more consistent internal event log than we > currently maintain, but I think ordering issues become really > complicated too -- if you installed a package then started a service, > you have to do them in the inverse order, but if you modified a file > and restarted the service then you have to do them in the same order. > > Basically, you need a much richer language for talking about > dependencies, and I think that's the real complexity. > > -- > Risk! Risk anything! Care no more for the opinions of others, for those > voices. Do the hardest thing on earth for you. Act for yourself. Face > the truth. -- Katherine Mansfield > --------------------------------------------------------------------- > Luke Kanies |http://reductivelabs.com|http://madstop.com
As nice as it might be to have completely reversible resources, I don't think we need quite that much. Instead, I would like something like the notify parameter, but specifically triggered on failure only. i.e.: exec {"generic install" command => "mkdir -p /opt/program ; tar -xzf /tmp/program- $kernel.tar.gz -C /opt/program", creates => "/opt/program", onfail => Exec["opps"], } exec => { "opps": command => "rm -rf /opt/program", refreshonly => true, } Basically, just making it easy to create and call custom undo scripts or functions. Even though the creates paramater is bad, the exec would try again next run because /opt/program gets removed on failure. And than "opps" will only run after a failure of "generic install". With the way notify works, an undo could start triggering other resources as well; although the potential undo-redo cycle might be problematic. --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---