Project

General

Profile

Feature #1353

Foreman should be able to handle pre and post hook action.

Added by Romain Vrignaud almost 8 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Plugins-Engines
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

It would be awesome to be able to schedule pre and post hook before specific action.

This is one of my use case I'd like to be able to achieve with Foreman :
If I click on "Build an host", I'd like to be able to program an hook to make wget on a webservice I wrote to schedule a Nagios Downtime during the server rebuild"

I'm sure we could find a lot of different use cases.

Thx in advance


Related issues

Related to Foreman - Feature #1194: Support hooking into host creation/deletionResolved2011-09-29
Related to Foreman - Feature #58: trigger actions when a New sucessful host is addedClosed2009-11-03

Associated revisions

Revision ca166dba (diff)
Added by Joseph Magen almost 7 years ago

fixes #1353 added custom hook when host build mode changes

see http://theforeman.org/projects/foreman/wiki/Custom_Hooks_in_Plugin

History

#1 Updated by Greg Sutcliffe almost 8 years ago

Seconded - for unattended ArchLinux installs, it is (currently, this may change) necessary to start a Network Block Device (NBD) serving the Arch Install ISO to the PXE booted client. This would replace the manual step of starting and stopping the NBD device.

This could also be used for users to provide arbitrary scripts, such as downloading vmliuz/initrd/iso files for PXE to use, and so on.

Ohad, is this similar to what Foreman does when downloading the initrd/vmlinuz files for existing supported distributions?

#2 Updated by Ohad Levy almost 8 years ago

Greg Sutcliffe wrote:

Ohad, is this similar to what Foreman does when downloading the initrd/vmlinuz files for existing supported distributions?

not at all, Foreman simply tell the proxy where to fetch the boot file from, then the proxy is fetching and putting it in the right place.

#3 Updated by Ohad Levy over 7 years ago

I'm guessing we can add observer actions to most stuff

#4 Updated by Rytis Sileika almost 7 years ago

+1

My use case:

I want to remove node from Pulp server before I rebuild it.

#5 Updated by Ohad Levy almost 7 years ago

i think we can do it by adding additional callbacks (such as after_built, before_built etc)
http://www.intridea.com/blog/2012/3/22/define-custom-callbacks-for-activerecord-and-more

#6 Updated by Joseph Magen almost 7 years ago

I submit a pull request https://github.com/theforeman/foreman/pull/311 which adds a custom callback callback called :ready_for_build

You can read more about this at http://theforeman.org/projects/foreman/wiki/Custom_Hooks_in_Plugin

#7 Updated by Ohad Levy almost 7 years ago

  • Category set to Plugins-Engines
  • Assignee set to Joseph Magen
  • Target version set to 1.1

#8 Updated by Anonymous almost 7 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF