Virtual resources not refreshing, how to clean out and re-do?

67 views
Skip to first unread message

Steve Wray

unread,
Aug 5, 2015, 2:10:07 PM8/5/15
to Puppet Users
I have a problem where a virtual resource has, in an early run, got the wrong value. I've fixed the manifest so that the virtual resource gets the correct values and I've rerun Puppet on the node that populates the virtual resource. However when it is instantiated it still gets the old value.

I've used 'puppet node clean' for both the node where the virtual resource is created/populated and on the node where the virtual resource is instantiated and its still coming in with the wrong value. 

If I drop the puppetdb database (its postgres) and rerun Puppet on both sides the virtual resource gets the correct new values. 

This seems like a very extreme measure for an environment with many nodes and many virtual resources, just to clean out one incorrect value.

What is the correct way to fix this situation?

Thanks

Matthew Burgess

unread,
Aug 5, 2015, 2:28:49 PM8/5/15
to puppet...@googlegroups.com

Run

puppet node deactivate agent-hostname

on your master. That nullifies all exported resources for that host, which then get repopulated on the next agent run.

Matt.

Steve Wray

unread,
Aug 5, 2015, 4:24:33 PM8/5/15
to Puppet Users
Oh thanks, that worked. 

I guess I was confused with the semantics of 'clean' and 'deactivate' and thought 'deactivate' would... deactivate the node not just 'clean' out its virtual resources :)

It would be nice if there was a curl interface for puppetdb to delete specific virtual resources! So far as I can tell it doesn't work with -X DELETE at all.

jcbollinger

unread,
Aug 6, 2015, 10:39:26 AM8/6/15
to Puppet Users


On Wednesday, August 5, 2015 at 3:24:33 PM UTC-5, Steve Wray wrote:
Oh thanks, that worked. 

I guess I was confused with the semantics of 'clean' and 'deactivate' and thought 'deactivate' would... deactivate the node not just 'clean' out its virtual resources :)

It would be nice if there was a curl interface for puppetdb to delete specific virtual resources! So far as I can tell it doesn't work with -X DELETE at all.



For future reference, the term you are looking for is exported resource.  Virtual resources are a different, albeit related, thing.  Exported resources are primarily for collection and application on nodes different from the one that declares them.  Virtual resources can be collected / realized and applied only to the same node that declares them.


John

Reply all
Reply to author
Forward
0 new messages