Feature #1194
closedSupport hooking into host creation/deletion
Description
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".
Updated by Ohad Levy about 13 years ago
would a simple script executed by foreman user would suffice?
at the moment, since there are is no background processing in foreman, the request would block the UI (e.g. the UI would wait until the script would finish)
Updated by Benjamin Goldsbury about 13 years ago
Seems fine to me. Would be nice if Foreman could capture stdout/stderr and/or warn the user on a non-0 exit of the script.
Updated by Ohad Levy about 13 years ago
would you like to get a notice in the UI / email ?
who should be noticed? the owner of the host? the creator of the host?
Updated by Benjamin Goldsbury about 13 years ago
I think notification through the UI is a reasonable starting place.
Updated by Ohad Levy over 12 years ago
following a discussion on irc
here is an example http://pastie.org/3888211
Updated by marcelo veglienzone about 12 years ago
I would like to see something like this to have foreman update freeipa upon host creation
Updated by Joseph Magen almost 12 years 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
Updated by Ohad Levy almost 12 years ago
- Category set to Plugin integration
- Status changed from New to Resolved
- Assignee set to Joseph Magen
- Target version set to 1.1