-
Bug
-
Resolution: Done
-
Normal
-
None
-
6.15.0
-
0
-
False
-
-
False
-
CLOSED
-
0
-
Rocket
-
-
-
Sat_docs_8_2024
-
Moderate
-
No
Description of problem:
When running Ansible Remote Execution Tasks against multiple hosts, the host parameter from the first host of the batch of hosts is being used to render the job template for all hosts. The Job Task output shows the correct host parameter for all hosts, however, the job template renders based on the first host, which can cause issues for other hosts that have a different host parameter.
Eng comment:
Host parameters are available as variables when the playbook runs so instead of rendering the template differently for different hosts, it is preferred to have the template render to the same playbook for all hosts and let ansible do different things with it.
> The job template will render according to the very first host's host parameter
Under the hood the job template gets rendered separately for each host, but then all the rendered variants are ignored except for the first one. As far as I know Ansible itself does not allow running multiple playbooks against multiple hosts with a single ansible-playbook invocation so there's that.
However, the issue is there, there's no denying that, but we could at least document the recommended way of doing things to prevent people from running into this, especially if we consider the ansible-native way to be superior in probably all regards.
- is duplicated by
-
SAT-26067 Running ansible playbook on multiple hosts gives wrong host parameter result
- Closed