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

Added current Foreman user as argument to hook script #47

Closed wiad closed 6 years ago

wiad commented 7 years ago

Resolves #44

domcleal commented 6 years ago

Thanks, but I'm worried this changes the interface significantly and is likely to cause failures in scripts checking their expected arguments. Could you pass it through as an environment variable instead?

wiad commented 6 years ago

ok, you mean setting the environment variable in util.rb before running the scripts? yeah, that should work, and I understand your concerns.

wiad commented 6 years ago

Setting the env variable via ENV in util.rb does not seem to carry to the hook scripts. My ruby is poor, but i guess it has to do with the way the hook scripts are called. Did you have another method in mind?

wiad commented 6 years ago

eh, disregard that, just have to set it in the right place... I'll get back to you with a new patch