# How to references a list of host in play book?

**URL:** <https://forum.ansible.com/t/how-to-references-a-list-of-host-in-play-book/21518>\
**Category:** Ansible Project\
**Created:** [May 23, 2016, 1:03am UTC](https://forum.ansible.com/t/how-to-references-a-list-of-host-in-play-book/21518 "2016-05-23T01:03:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sicheng\_Tang](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@Sicheng\_Tang](https://forum.ansible.com/u/Sicheng_Tang)\
**Post date:** [May 23, 2016, 1:03am UTC](https://forum.ansible.com/t/how-to-references-a-list-of-host-in-play-book/21518/1 "2016-05-23T01:03:09Z")

</div>

Suppose I have a group of host, whose Ip are 10.129.51.158,10.129.50.235,10.129.50.234, and I define it as a variable  
ip = 10.129.51.158,10.129.50.235,10.129.50.234

Is there any to to generate a play book like this by referencing this variable ?

[my-role]  
10.129.51.158

10.129.50.235

10.129.50.234

[my-role:var]  
db\_user = tang
