# Variable for "hosts:" value in playbook

**URL:** <https://forum.ansible.com/t/variable-for-hosts-value-in-playbook/28585>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [September 17, 2018, 6:59am UTC](https://forum.ansible.com/t/variable-for-hosts-value-in-playbook/28585 "2018-09-17T06:59:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![google](https://avatars.discourse-cdn.com/v4/letter/g/258eb7/32.png) [@google](https://forum.ansible.com/u/google)\
**Post date:** [September 17, 2018, 6:59am UTC](https://forum.ansible.com/t/variable-for-hosts-value-in-playbook/28585/1 "2018-09-17T06:59:55Z")

</div>

Hi Team;

I have been trying to find an answer for this, but can’t seem to find a solution anywhere.

The situation is as follows;

I am running an AWX server, and I have a number of servers;

as an example;

Site1ServerWEB01  
Site1ServerWEB02  
Site1ServerPXY01  
Site2ServerPXY02

Site2ServerWEB01  
Site2ServerWEB02  
Site2ServerPXY01  
Site2ServerPXY02

I have then created via the AWX web interface, a Smart Inventory, which is based on the site name; ie inventory name “Site1” (contains all servers beginning with Site1) , “Site2” (contains all servers beginning with Site2)

I then want to have 1 master YAML file which contains all the tasks that I want to run…

However I want the playbook broken up as follows;
