Bug #37720
closedHost remains in build mode during registration when setup_insights is set to true
Description
When using global registration method to register a system and setup_insights is set to true, The registration process will terminate immediately after completing the execution of "insights-client --register" and the host never exists from build mode.
Based on the recent internal discussions, It's happening because of how we execute the whole `register_katello_host` function i.e. straightaway pipe it to bash. The current working hypothesis is that insights-client somehow hijacks the pipe that is used to pass the inner script into bash. And hence needed to find out a way to feed the whole function to some different way to bash and execute it.
The best way to do so is to pass the function content as virtual file to bash e.g.
instead of
register_katello_host | bash
we can do
bash <(register_katello_host)
And that allows the execution to complete without any issues