Support hooking into host creation/deletion
|Assignee:||Joseph Magen||% Done:|
|Velocity based estimate||-|
Since the goal of Foreman is to support life-cycle management, it should have support for doing business-specific tasks based.
For example, we generate custom SSL certificates for various services on each host we run. While this could be accomplished in Puppet, it seems that Foreman is the more logical place to control this behavior.
This could be accomplished via a plugin architecture or just an option of "script to run when creating a host" and "script to run when deleting a host".
#7 Updated by Joseph Magen 12 months ago
You can implement hooking into host creation/deletion by writing a Foreman Plugin - http://theforeman.org/projects/foreman/wiki/Plugins
Just follow the example at http://theforeman.org/projects/foreman/wiki/How_to_Create_a_Plugin
module HostExtensions extend ActiveSupport::Concern included do execute standard callbacks after_create :do_this after_destroy :do_that execute custom hooks after_ready_for_build :do_something_special_after_build def do_something_special_after_build p "doing customized callback something special AFTER build" end end end