Hi, On 23.05.16 03:09 Sicheng Tang wrote: > Hi all: > I have a group of host whose IPs > are 10.129.51.158,10.129.50.235,10.129.50.232 and I will define them as > variable, like this > ip = 10.129.51.158,10.129.50.235,10.129.50.232 > > Is there any way to generate a play book like this by referencing this ip? > > [my-role] > 10.129.51.158 > 10.129.50.235 > 10.129.50.232 > > [my-role:vars] > ,,,,, >
I'm sorry, I do not understand your question. As you have not gotten any answers yet, it might be others have not understood it, too. What you outline above is part of a hosts file. But where do you want to define the ip? And what should it be used for? Do you want to iterate/loop over all members of your group my-role? That can be done. See the example in the docs: https://docs.ansible.com/ansible/playbooks_loops.html#id29 Johannes -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/574B455A.6090601%40ojkastl.de. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: OpenPGP digital signature
