Custom Resource Purging

122 views
Skip to first unread message

Marc DiPasquale

unread,
May 15, 2014, 4:44:02 PM5/15/14
to puppet...@googlegroups.com
Is it possible to use the resource metatype (or some other way) to purge my custom resource?
I'm using Puppet v3.4.3 (Puppet Enterprise 3.2.0)

I have a custom resource that is exported by a puppet module when an application is installed.
This resource is collected on a management node and added to a load balancer via a Web Services call. 
What I would like to do is somehow have the ability to purge this resource from my load balancer when they no longer exist during the puppet resource collection.

Thanks in advance!



jcbollinger

unread,
May 16, 2014, 9:14:33 AM5/16/14
to puppet...@googlegroups.com


You can use the Resources meta-resource to purge resources of any type, provided that (1) the resource type is Ensurable, and (2) it performs prefetching.  Being ensurable is necessary because that's what Resources uses to remove unmanaged resources.  Prefetching is necessary because that's how Resources knows which unmanaged resources are present on the target node.

Any other solution for removing unmanaged resources is going to be specific to the resource type, and likely pretty messy.  The biggest hurdle is (2): you somehow need to determine what resources are present.  The next biggest is to filter out the managed resources from the list of all resources.  Once you've identified the resources to purge, actually removing them is usually straightforward.


John

Reply all
Reply to author
Forward
0 new messages