Hey guys, i hope someone has an idea for me. At this time im using Puppet Dashboard as enc for a masterless puppet infrastructure.No im searching for a best practise to undo the changes from a removed class. Example: In the enc I´ve added the class auth::test to a node. The class will be loaded on the next puppet apply, works fine. But now if i remove the class from the node in the enc, how is the best practise to undo the changes from these class? My thoughts are to include an "undo" class if the class "auth::test" isnt defined/tagged?? But on this way puppet fails with duplicates declarations in the catalog, of course?! Hope you´ve some good ideas for me. Thank you and kind regards, Rene P.S. Sry for my bad english ;) -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/a60c81f6-2d1c-4ddb-bada-6970591b55cc%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-Oct-31 13:32 UTC
[Puppet Users] Re: Undo changes from removed class (ENC)
On Thursday, October 31, 2013 4:16:04 AM UTC-5, Ano nym wrote:> > Hey guys, > > i hope someone has an idea for me. At this time im using Puppet Dashboard > as enc for a masterless puppet infrastructure.No im searching for a best > practise to undo the changes from a removed class. > > Example: In the enc I´ve added the class auth::test to a node. The class > will be loaded on the next puppet apply, works fine. But now if i remove > the class from the node in the enc, how is the best practise to undo the > changes from these class? > > My thoughts are to include an "undo" class if the class "auth::test" isnt > defined/tagged?? But on this way puppet fails with duplicates declarations > in the catalog, of course?! >I don''t know why you say "of course" there. If Puppet can successfully apply a catalog containing a class "auth::test", then there is no reason to expect duplicate resources if you swap out auth::test for a different class that declares only resources that are declared by auth::test. Puppet''s restriction against duplicate declarations applies only to resources actually declared for a given target node; it is not a general restriction against duplicate declarations anywhere among all manifests available to the master. In fact, there is no applicable general-purpose sense of "undoing" a class. There are several reasons for that, but one of the simplest is that Exec resources cannot be un-run. The bottom line, then, is that you must define what you mean by "undoing" a given class, and you must apply it either via an alternative class (just as you considered), or by switching the behavior of the class of interest itself via conditional logic or perhaps by modifying the external data the class relies upon. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/3b1cb761-e23e-44c1-997b-43c44203cc0c%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.