Tracking orphaned resources

32 views
Skip to first unread message

Martin Langhoff

unread,
May 29, 2014, 9:59:12 AM5/29/14
to puppet-dev, puppet...@googlegroups.com

As the complexity of our $workplace puppet configuration grows, I am increasingly worried that puppet gives us very limited visibility over resources it no longer manages.

In practical terms: if I mess up my class include/require/inherit structure so that a node A no longer indirectly includes module Foo, resources managed by Foo are present in A but "orphaned".

This is a lurking gotcha; and it can lead to subtle problems.

Is there any tool that helps here, for example keeping a manifest of all resources ever managed by this puppet install? If not, I will probably try build that into ppg.

Is there a way to ask puppet for a fuller, more explicit report of all resources tracked during a run?

Thanks,

m

David Schmitt

unread,
May 29, 2014, 10:06:00 AM5/29/14
to puppet...@googlegroups.com
https://github.com/ripienaar/puppet-catalog-diff , --evaltrace and
rspec-puppet come to mind as different solutions to your problem.


Regards, David

Christopher Wood

unread,
May 29, 2014, 10:13:36 AM5/29/14
to puppet...@googlegroups.com
Not that I've heard of such a tool, but if you archived catalogs somewhere you could compare the lists of resources over time. Or you could turn on catalog hash debugging to grab the current/previous catalog for the same technique:

http://docs.puppetlabs.com/puppetdb/latest/trouble_low_catalog_duplication

Not that I've ever tried this, I should point out.
> --
> 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 [1]puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> [2]https://groups.google.com/d/msgid/puppet-users/CACPiFCLhd34r%3DNjC91kFOq97VGbUpbdWmYC1Z75CgirmO%2Btsug%40mail.gmail.com.
> For more options, visit [3]https://groups.google.com/d/optout.
>
> References
>
> Visible links
> 1. mailto:puppet-users...@googlegroups.com
> 2. https://groups.google.com/d/msgid/puppet-users/CACPiFCLhd34r%3DNjC91kFOq97VGbUpbdWmYC1Z75CgirmO%2Btsug%40mail.gmail.com?utm_medium=email&utm_source=footer
> 3. https://groups.google.com/d/optout

Erik Dalén

unread,
May 29, 2014, 11:04:09 AM5/29/14
to Puppet Developers, puppet...@googlegroups.com
There is /var/lib/puppet/state/state.yaml that records all resources ever managed and when they were last checked & synced. However it only has the type and title of the resources, so it might be tricky to actually find out what they were in some cases.

I'm not aware of any tools that make good use of that file, but perhaps someone else knows or you could come up with something.


--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CACPiFCLhd34r%3DNjC91kFOq97VGbUpbdWmYC1Z75CgirmO%2Btsug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Erik Dalén

Henrik Lindberg

unread,
May 29, 2014, 8:35:00 PM5/29/14
to puppet...@googlegroups.com, puppe...@googlegroups.com
On 2014-29-05 15:58, Martin Langhoff wrote:
> As the complexity of our $workplace puppet configuration grows, I am
> increasingly worried that puppet gives us very limited visibility over
> resources it no longer manages.
>
> In practical terms: if I mess up my class include/require/inherit
> structure so that a node A no longer indirectly includes module Foo,
> resources managed by Foo are present in A but "orphaned".
>
> This is a lurking gotcha; and it can lead to subtle problems..
>
> Is there any tool that helps here, for example keeping a manifest of all
> resources ever managed by this puppet install? If not, I will probably
> try build that into ppg.
>
> Is there a way to ask puppet for a fuller, more explicit report of all
> resources tracked during a run?
>
> Thanks,
>
One way of doing this is to use rspec puppet and write specs for
the base line - "these things should be in the catalog", then run those
tests as part of development to ensure that things that should be in the
catalog are not accidentally dropped as you refactor or make other changes.

- henrik

> m
>
> --
> 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...@googlegroups.com
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CACPiFCLhd34r%3DNjC91kFOq97VGbUpbdWmYC1Z75CgirmO%2Btsug%40mail.gmail.com
> <https://groups.google.com/d/msgid/puppet-users/CACPiFCLhd34r%3DNjC91kFOq97VGbUpbdWmYC1Z75CgirmO%2Btsug%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

Reply all
Reply to author
Forward
0 new messages