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

Missing hooks are failures #42

Closed dekimsey closed 7 years ago

dekimsey commented 7 years ago

If a hook is deleted, tasks will fail. Additionally, it is unclear when/where hooks get installed or uninstalled.

Hook: 50-ad_realm task failed with the following error: No such file or directory - /usr/share/foreman/config/hooks/host/managed/create/50-ad_realm
 | Errno::ENOENT: No such file or directory - /usr/share/foreman/config/hooks/host/managed/create/50-ad_realm
 | /opt/rh/rh-ruby22/root/usr/share/ruby/open3.rb:193:in `spawn'
 | /opt/rh/rh-ruby22/root/usr/share/ruby/open3.rb:193:in `popen_run'
 | /opt/rh/rh-ruby22/root/usr/share/ruby/open3.rb:188:in `popen2e'
 | /opt/rh/rh-ruby22/root/usr/share/ruby/open3.rb:335:in `capture2e'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_hooks-0.3.13/lib/foreman_hooks/util.rb:46:in `exec_hook_int'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_hooks-0.3.13/lib/foreman_hooks/util.rb:34:in `block in exec_hook'
 | /opt/rh/rh-ruby22/root/usr/share/gems/gems/bundler-1.7.8/lib/bundler.rb:236:in `block in with_clean_env'
 | /opt/rh/rh-ruby22/root/usr/share/gems/gems/bundler-1.7.8/lib/bundler.rb:223:in `with_original_env'
 | /opt/rh/rh-ruby22/root/usr/share/gems/gems/bundler-1.7.8/lib/bundler.rb:229:in `with_clean_env'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_hooks-0.3.13/lib/foreman_hooks/util.rb:34:in `exec_hook'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_hooks-0.3.13/lib/foreman_hooks/orchestration_hook.rb:57:in `hook_execute_set'
 | /usr/share/foreman/app/models/concerns/orchestration.rb:195:in `execute'
 | /usr/share/foreman/app/models/concerns/orchestration.rb:135:in `block in process'
 | /usr/share/foreman/app/models/concerns/orchestration.rb:127:in `each'
 | /usr/share/foreman/app/models/concerns/orchestration.rb:127:in `process'
 | /usr/share/foreman/app/models/concerns/orchestration.rb:35:in `around_save_orchestration'