How do I refer to the previously defined variable in "with_nested"?

For example, I would like to do something like this:

  • name: install git repos for all users
    git: “repo={{ item[1].repo }} dest={{ item[0].home }}/{{ item[1].dest }}”
    with_nested:
  • users
  • item[0][‘repos’][‘git’]

I *think* you want the with_subelement lookup plugin.

see
http://www.ansibleworks.com/docs/playbooks_loops.html#looping-over-subelements
other example also via https://github.com/ansible/ansible/pull/4071​​