For Ansible Tower can we pass hostname as variable to job template , so that when the Job template is Run we can pass the host details dynamically during runtime and playbook would run on this host. Basiacally this variable should then update the inventory file
Asked
Active
Viewed 857 times
1 Answers
0
Well, yes and no. You can have a variable for the hosts
in a play, and then set that variable in Tower. So your playbook would look like this:
---
- hosts: "{{ my_host_variable }}"
tasks:
.
.
.
And pass my_host_variable
in with the template.

Jack
- 5,801
- 1
- 15
- 20