We want to run a REX job directly on foreman/smart proxy. We need this to start ansible-playbook on the smart proxy in order to configure the application hosts. So, the ansible-playbook would run once for all hosts which are linked to the specific smart proxy.
Currently we do it like this:
This has a big drawback as it won’t work if the smart proxy host uses different organization / location because Host.find() only finds hosts of the currently selected organization / location. Means, the smart proxy host need to have exactly the same organization / location than the deployed application hosts.
I guess, there are other scenarios where it make sense to reference a smart proxy directly. What are your thoughts?
There is one workaround: instead of referencing the smart proxy directly, reference ONE host of the application. REX wiill determine the smart proxy on which the REX job should be started and everything should work. Drawback: in the REX job the ONE host is referenced.
Do you have an idea how to fix this somehow else?