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

Hook scripts found and registered but never called #9

Closed m-barthelemy closed 11 years ago

m-barthelemy commented 11 years ago

Hi,

I'm currently using the development branch of Foreman. I installed the foreman_hooks plugin, and it seems to be loaded fine. I had errors at first because I defined my hook scripts in config/hooks/host instead of config/hooks/host/managed but now I can see in the log that the plugin finds my scripts (and tells they have been registered).

I then provisioned several Rackspace VMs, everything went fine but none of my hook script were called. I carefully checked the scripts permissions. For now I have 3 scripts, inside hosts/managed/create/, host/managed/destroy/ and host/managed/after_build/.

Why are these script not getting called? There is nothing in the log. Could it be because I'm using a development version of Foreman (2013/07/14)? Or because I'm provisioning Rackspace/cloud VMs?

Thanks for your help.

domcleal commented 11 years ago

I think it's because it's a VM, same as issue #5. Sorry I haven't had time to look into it further.

m-barthelemy commented 11 years ago

Thanks for the fast reply. I had a quick look at Foreman's code but unfortunately I'm not a Ruby developer and couldn't find why it wouldn't call the plugin (or wouldn't generate the callbacks/events used by the plugin).

Do you plan to check that when you have time? Is there anything I can do to help?

domcleal commented 11 years ago

I think this issue has been fixed in a478828 - it was an issue when running in Rails' production mode thanks to an optimisation I added in 0.3.2, which only worked in development mode. I'll make a new release shortly after some more testing. Thanks for your patience!