<p dir="auto">arrays defined in vars or vars_files work ok, while those from host/group vars and inventory (${groups.somegroup} are handled incorrectly</p>
<p dir="auto">See attached gist (full test case with output)<br>
<a href="https://gist.github.com/mkaluza/6121615">https://gist.github.com/mkaluza/6121615</a></p>
<p dir="auto">vars 'a' and 'c' behave correctly, while var 'b' and group 'grp' does not</p>
<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Bug Report</p>
<h5 dir="auto">Ansible Version:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 1.9.1
  configured module search path = None"><pre class="notranslate"><code class="notranslate">ansible 1.9.1
  configured module search path = None
</code></pre></div>
<h5 dir="auto">Ansible Configuration:</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Mac OSX 10.9.5</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">Roles that are included multiple times cannot have their dependencies included multiple times.  The documentation states that <code class="notranslate">allow_duplicates</code> accomplish something like this so long as the dependency is included multiple times from the <em>same</em> role, but it does not seem to work for the aforementioned case.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">Here's a simple set of playbooks / roles that should illustrate the problem.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="###  ./hypervisor-1.yml

---
- hosts:
    - host1
  roles:
    - role: vm
      name: red
    - role: vm
      name: blue

###  ./hypervisor-2.yml

---
- hosts:
    - host2
  roles:
    - role: vm
      name: green
    - role: vm
      name: yellow
    - role: vm
      name: purple

###  ./inventory
[hosts]
host1
host2

###  ./roles/disk/tasks/main.yml
- debug: msg=&quot;Setting up disk for {{ path }}&quot;

###  ./roles/vm/meta/main.yml

---
allow_duplicates: yes
dependencies:
  - role: disk
    path: &quot;/path/to/{{ name }}&quot;

###  ./roles/vm/tasks/main.yml
- debug: msg=&quot;Installing VM {{ name }}&quot;"><pre class="notranslate"><code class="notranslate">###  ./hypervisor-1.yml

---
- hosts:
    - host1
  roles:
    - role: vm
      name: red
    - role: vm
      name: blue

###  ./hypervisor-2.yml

---
- hosts:
    - host2
  roles:
    - role: vm
      name: green
    - role: vm
      name: yellow
    - role: vm
      name: purple

###  ./inventory
[hosts]
host1
host2

###  ./roles/disk/tasks/main.yml
- debug: msg="Setting up disk for {{ path }}"

###  ./roles/vm/meta/main.yml

---
allow_duplicates: yes
dependencies:
  - role: disk
    path: "/path/to/{{ name }}"

###  ./roles/vm/tasks/main.yml
- debug: msg="Installing VM {{ name }}"
</code></pre></div>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">Running the first playbook, <code class="notranslate">hypervisor-1.yml</code>, should give output that shows a disk is set up for both <code class="notranslate">red</code> and <code class="notranslate">blue</code>, as well as the installation of the VM for both.</p>
<h5 dir="auto">Actual Results:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [host1] ****************************************************************** 

GATHERING FACTS *************************************************************** 
ok: [host1]

TASK: [disk | debug msg=&quot;Setting up disk for /path/to/red&quot;] ******************* 
ok: [host1] =&gt; {
    &quot;msg&quot;: &quot;Setting up disk for /path/to/red&quot;
}

TASK: [vm | debug msg=&quot;Installing VM red&quot;] ************************************ 
ok: [host1] =&gt; {
    &quot;msg&quot;: &quot;Installing VM red&quot;
}

TASK: [vm | debug msg=&quot;Installing VM blue&quot;] *********************************** 
ok: [host1] =&gt; {
    &quot;msg&quot;: &quot;Installing VM blue&quot;
}

PLAY RECAP ******************************************************************** 
host1                      : ok=4    changed=0    unreachable=0    failed=0 "><pre class="notranslate"><code class="notranslate">PLAY [host1] ****************************************************************** 

GATHERING FACTS *************************************************************** 
ok: [host1]

TASK: [disk | debug msg="Setting up disk for /path/to/red"] ******************* 
ok: [host1] =&gt; {
    "msg": "Setting up disk for /path/to/red"
}

TASK: [vm | debug msg="Installing VM red"] ************************************ 
ok: [host1] =&gt; {
    "msg": "Installing VM red"
}

TASK: [vm | debug msg="Installing VM blue"] *********************************** 
ok: [host1] =&gt; {
    "msg": "Installing VM blue"
}

PLAY RECAP ******************************************************************** 
host1                      : ok=4    changed=0    unreachable=0    failed=0 
</code></pre></div>
<p dir="auto">Note the disk is only set up for <code class="notranslate">red</code> and is skipped for <code class="notranslate">blue</code>.</p>