To use AWX for Multiple hosts

Hi Team,

I have configured the Ansible AWX but now I want to use it to run the playbook in multiple hosts.
But the catch is how will I enter multiple IPs in the host file also I am using variables at run time so how will I manage it?

Sharing a screenshot for better understanding.

My query is how I pass different values of these variable as I have multiple hosts at a single time.
Screenshot from 2024-01-18 18-15-40

it looks like you’re trying to pass extra_vars when you should instead be assigning host_vars and/or group_vars in whatever inventory you’re targeting with your playbook.

Hi, toast

Thanks for replying.
Though let me tell you once again the issue I am facing I have my template ready to run the playbook on Ubuntu and it is working fine but I am passing some variable values during the run time like the screenshot I have shared.

In the case of a single client, it is working fine as I have only one value for var “shared_user”(example) and it executes the playbook.

In case of multiple or two clients, now the var needs to hold two values so how will it hold the multiple values and how will it execute the playbook for both machines at same time.?

as @toast said, you can create an inventory file that allows you to specify variables per host

So the idea is to create an inventory file with your hosts and group_vars, and put it on github, then create an inventory source to import the hosts from that inventory file

See this section on how to construct such an inventory file

https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html#assigning-a-variable-to-many-machines-group-variables

then do import this into AWX, see this doc

https://ansible.readthedocs.io/projects/awx/en/latest/userguide/inventories.html#ug-inventories-add-source

Let us know if this is helpful, or if you have more questions!

Seth