Feature #2286
closedRun 'puppet node deactivate' upon removing a host
Description
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.
See http://docs.puppetlabs.com/puppetdb/1.1/maintain_and_tune.html#deactivate-decommissioned-nodes
Foreman does not currently do this when a node is removed.
Updated by Jeremy Kitchen over 11 years ago
+1 this.
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 :)
Updated by Dominic Cleal over 11 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:
https://github.com/cernops/puppetdb_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.
Updated by Ohad Levy over 11 years ago
- Status changed from New to Resolved
I'm closing this feature request as its functionality is available via a plugin.
maybe a follow up would be to create a packaging task(s) for the plugin?
Updated by Dominic Cleal over 11 years ago
For the record, the plugin's been packaged as an RPM and is available in our plugins repo: ruby193-rubygem-puppetdb_foreman and rubygem-puppetdb_foreman.