Run 'puppet node deactivate' upon removing a host
If you're using PuppetDB, when you remove a host you need to run 'puppet node deactivate fqdn' in order to let PuppetDB know that the exported resources are no longer active.
Foreman does not currently do this when a node is removed.
#1 Updated by Jeremy Kitchen almost 5 years ago
The change should be fairly straightforward. Add the deactivate functionality to foreman-proxy and then have foreman call it when deleting a host.
The issue comes in with usability. Older versions of puppet don't have the deactivate functionality, so how do we handle those cases? Silently ignore and keep existing behavior (read: don't worry about storeconfigs and such) or spit out a warning? or?
I'm all for doing the work to make this happen, as I have somewhat of a need for it in my environment. I think a short discussion regarding the edge cases is in order before I get started, though :)
#2 Updated by Dominic Cleal almost 5 years ago
- Tracker changed from Bug to Feature
- Description updated (diff)
- Category set to Puppet integration
Worth mentioning here is this plugin, which does an API call to PuppetDB to deactivate the node when deleted from Foreman:
I don't think the "deactivate" action is available in core Puppet, it's a PuppetDB extension, so it'd have to be something that's configurable if we included it in core Foreman.