How to references a list of host in play book?

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