theforeman / foreman_hooks

Run custom hook scripts on Foreman events
http://m0dlx.com/blog/Extending_Foreman_quickly_with_hook_scripts.html
GNU General Public License v3.0
56 stars 50 forks source link

Not able to run hooks for "host/discovered" events from forman_discovery plugin #23

Closed phirince closed 9 years ago

phirince commented 9 years ago

As per this link, this is supported:

https://www.omniref.com/ruby/gems/foreman_hooks/0.1.0

But I tried putting a script in the directory ~foreman/config/hooks/host/discovered/{create, destroy}.

But I get this error in the logs: 2015-07-16 09:39:04 [W] Host::Discovered doesn't support orchestration, can't run orchestration hooks: use Rails events instead

I checked the Host::Discovered class and it doesn't include Orchestration module. Is this a limitation of the class? If so, the above link should be corrected. Is there any way to use the callback hooks or any other mechanism to achieve the same?

Thanks, -PP

domcleal commented 9 years ago

The link is for version 0.1.0, which is rather old - the README in the current release does not list this suggestion.

Any of the Rails events should still work.

phirince commented 9 years ago

Normal rails events are working. But there is a problem of not able to find rabl files for them. But that's a separate issue. I'll open another issue for that.