It's iterating over your list of items correctly, but by indexing to [0], it's taking the first char of the item, which happens to be '/'. Remove the [0] and you should be fine.
On Wed, Dec 11, 2013 at 9:10 AM, Michael Baydoun <[email protected]>wrote: > I expected the following to init a git repository in /home/youruser/a, but > instead it's created created in / > > what am I doing wrong? > > --- > > - hosts: yourhost > > user: root > > gather_facts: no > > tasks: > > - shell: /usr/bin/git init chdir={{ item[0] }} > > with_items: > > - [ '/home/youruser/a', '/home/youruser/b', '/home/youruser/c', > '/home/youruser/d' ] > > -- > 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]. > For more options, visit https://groups.google.com/groups/opt_out. > -- 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]. For more options, visit https://groups.google.com/groups/opt_out.
