Custom Hooks in Plugin

Foreman hooks where introduced starting in Foreman 1.1. Currently, there are only two custom hooks defined as "after_build" and "before_provision".

Your plugin can utilize this hook by looking at the example in https://github.com/isratrade/foreman_plugin_template

module ForemanReserve
  module HostExtensions
    extend ActiveSupport::Concern

      included do
        after_build :do_something_special_after_build
        before_provision :do_this_before_provision

        def do_something_special_after_build
          p "doing customized callback something special after build" 
        end
        def do_this_before_provision
          p "doing this before provision" 
        end
      end

    end
  end
end