Feature #2286

Run 'puppet node deactivate' upon removing a host

Added by Brian Rak over 8 years ago. Updated over 7 years ago.

Puppet integration
Target version:
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:


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 8 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 :)

#2 Updated by Dominic Cleal almost 8 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.

#3 Updated by Ohad Levy almost 8 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?

#4 Updated by Dominic Cleal over 7 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.

Also available in: Atom PDF