# To use AWX for Multiple hosts

**URL:** <https://forum.ansible.com/t/to-use-awx-for-multiple-hosts/3372>\
**Category:** Get Help\
**Tags:** awx\
**Created:** [January 18, 2024, 12:47pm UTC](https://forum.ansible.com/t/to-use-awx-for-multiple-hosts/3372 "2024-01-18T12:47:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinay](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@Vinay](https://forum.ansible.com/u/Vinay)\
**Post date:** [January 18, 2024, 12:47pm UTC](https://forum.ansible.com/t/to-use-awx-for-multiple-hosts/3372/1 "2024-01-18T12:47:58Z")

</div>

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](https://us1.discourse-cdn.com/ansible/original/2X/8/8ac5e7edd0941b4fa153e8f7341f563c1ca79937.png)

---

<div class="post-metadata">

**Author:** ![toast](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@toast](https://forum.ansible.com/u/toast)\
**Post date:** [January 18, 2024, 8:19pm UTC](https://forum.ansible.com/t/to-use-awx-for-multiple-hosts/3372/2 "2024-01-18T20:19:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Vinay](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@Vinay](https://forum.ansible.com/u/Vinay)\
**Post date:** [January 19, 2024, 7:42am UTC](https://forum.ansible.com/t/to-use-awx-for-multiple-hosts/3372/3 "2024-01-19T07:42:57Z")

</div>

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.?

---

<div class="post-metadata">

**Author:** ![fosterseth](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/fosterseth/32/101_2.png) [@fosterseth](https://forum.ansible.com/u/fosterseth)\
**Post date:** [January 19, 2024, 6:25pm UTC](https://forum.ansible.com/t/to-use-awx-for-multiple-hosts/3372/4 "2024-01-19T18:25:11Z")

</div>

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](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](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
