Puppet enforces state. It does know about state you have not defined. So if
you have a class that takes an ensure propert of absent, for instance, it
can enforce that. But it cannot guess what “the absence of this class”
means as a state model. Remember, your class model may say ‘make sure
apache is installed’, but the actual state model will apply all the
dependencies for apache. Turning that around to ‘make sure apache is NOT
installed’ will not remove the dependencies that were installed. So no,
there is no generic ‘absent’ value you can use to remove a class.

It is worth pointing out that immutable or ephemeral image patterns can
help with this. In essence, you do not change the classification of an
existing node, you delete that node and create a new node with the proper
classification. No chance of any sort of cruft or manual configuration
modifications persisting. Of course, that’s a goal most cannot fully
approach, but it is something to aspire to. I don’t know what your classes
are, but most people would not want to reclassify a database node as a web
app node, or vice verse. They may be okay with reclassifying a web app node
from application A to application B. There’s some value in those models
even if you can’t implement them fully.

On Wed, Oct 4, 2017 at 11:57 AM James Perry <jjperr...@gmail.com> wrote:

> Recently we have been changing out some software that was deployed via
> tarball extractions. Now we have a different app that deploys via RPM. To
> not break the legacy hosts where the new software doesn't we created a
> whole new class for deployments and setups on the new software.
>
> I've Googled, dug through forum posts and looked into a lot f modules, but
> couldn't find anyway to make what i would like to see if it is possible to
> do.
>
> Is there a way do a cleanup on removing the class? Ideally it would be
> nice to have some way to cleanup as well as check to be sure it is cleaned
> up if it doesn't have the class.
>
> I tried to write a class to do something like this for a specific set of
> classes to see if host has them as part of their catalog. Somewhere deep in
> my memory I think I remember there being a way to access the classes using
> a built-in call, but can;t seem to find it. I know I can reference
> the /opt/puppetlabs/puppet/cache/state/classes.txt file, but i was trying
> to be sure that the data was accurate by pulling off the master.
>
>    Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-dev/ededc7b7-c4cd-4820-bd72-be9103753b72%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-dev/ededc7b7-c4cd-4820-bd72-be9103753b72%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Rob Nelson

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/CAC76iT9wnqmvfEaXVLN6j4jabPo_LMKMQ12quZCqsr_BdzMgkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to