Fixes #3860 - automated discovery provisioning

Replaces https://github.com/theforeman/foreman_discovery/pull/97
> Should this not also check the value of Setting[:discovery_auto] ?

Yeah, I am moving this into this helper (concern now). Good idea.

-- 
Later,
 Lukas #lzap Zapletal