Project

General

Profile

Feature #2286

Run 'puppet node deactivate' upon removing a host

Added by Brian Rak over 5 years ago. Updated about 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Puppet integration
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

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.

History

#1 Updated by Jeremy Kitchen about 5 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 about 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:
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.

#3 Updated by Ohad Levy about 5 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 about 5 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