title: Using a relative path to reference another element in a multi dimensional array in Ansible-YAML
body: <p>I have a multidimensional array that's defined in YAML syntax. This is part of a group_vars file that's used by Ansible:</p>
  
  <pre><code>mirrors:
    - name: "ubuntu"
      dists: 
        - precise
        - precise-backports
        - precise-proposed
        - precise-security
        - precise-updates
      frontend_uri: "/ubuntu"
      package_pattern: "/ubuntu/pool"
      sync_hour: 0
      upstreams:
        main: "nl.archive.ubuntu.com"
        backups:
          - "ubuntu.mirror.ac.ke"
          - "ke.archive.ubuntu.com"
  </code></pre>
  
  <p>What bothers me is that <code>mirrors[0].frontend_uri</code> and <code>mirrors[0].package_pattern</code> could be generated out of <code>mirrors[0].name</code>, but to do this I would need to somehow reference them using a relative path because i don't want to include the iterator of the first level (<code>0</code>) into the path, more or less like this:</p>
  
  <pre><code>mirrors:
    - name: "ubuntu"
      dists: 
        - precise
        - precise-backports
        - precise-proposed
        - precise-security
        - precise-updates
      frontend_uri: "/{{ .name }}"
      package_pattern: "/{{ .name }}/pool"
      sync_hour: 0
      upstreams:
        main: "nl.archive.ubuntu.com"
        backups:
          - "ubuntu.mirror.ac.ke"
          - "ke.archive.ubuntu.com"
  </code></pre>
  
  <p>Is there any way to reference other parts of a multi dimensional array using a relative path?</p>