On Sun, Feb 19, 2012 at 5:07 PM, ruslan usifov <ruslan.usi...@gmail.com> wrote: > Hello > > Does anybody share how to roll-back configuration if puppet definition on > host is change. For example Let's assume we have host on which initial was > web server and bunch of users. All this resources we configured throw > puppet. > > > node <some node> > { > > <webserver difinition> > <user1 definition> > <user2 definition> > <user3 definition> > } > > At some point we decide to remove user2 so node config now looks like: > > node <some node> > { > > <webserver difinition> > <user1 definition> > <user3 definition> > } > > > but how to remove all user2 stuff that was on host? Undoubtedly we can > rewrite node definition like this: > > node <some node> > { > > <webserver difinition> > <user1 definition> > <remove user2 definition> > <user3 definition> > } > > But imho this doesn't look very good, becouse user removed only one time, > but node definition will be apply periodical.
I'd prefer this form, if only because it's explicit and, after your puppet update has rolled out, you can remove the, er, removal. By simply deleting the user definition from your configuration you are denying puppet that ability to manage that user anymore: puppet probably shouldn't be destroying things its not defined to manage. That said, if you absolutely _hate_ the last form there are things you might do to destroy a user, but the methods will be system dependent and contingent on your precise problem and needs. > Also this concerns webserver and other resources configured throw puppet. > How cleanup if resource definition will be removed from node? Mark the resources as absent in your puppet configuration. If you want puppet to manage the resource's creation having it manage the destruction is one of the more effective options. > > -- > 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. -- Brian L. Troutwine -- 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.