<h5 dir="auto">ISSUE TYPE</h5>
<p dir="auto">Bug Report</p>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">ec2_group integration test</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<p dir="auto">2.5</p>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Shippable</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Unstable integration test ec2_group:</p>
<p dir="auto"><a href="https://app.shippable.com/github/ansible/ansible/runs/54397/66/tests" rel="nofollow">https://app.shippable.com/github/ansible/ansible/runs/54397/66/tests</a></p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Run test on Shippable.</p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Tests pass.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">Tests are unstable or fail.</p>
<blockquote>
<p dir="auto">test/integration/targets/ec2_group/tasks/main.yml:908 / [localhost] amazon: ec2_group : assert that rule descriptions were modified (expected changed=true) that=[u'result.changed', u'result.ip_permissions_egress|length == 1']</p>
</blockquote>
<blockquote>
<p dir="auto">failure: rc=0</p>
</blockquote>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
    &quot;assertion&quot;: &quot;result.ip_permissions_egress|length == 1&quot;, 
    &quot;changed&quot;: false, 
    &quot;evaluated_to&quot;: false, 
    &quot;failed&quot;: true
}"><pre class="notranslate"><code class="notranslate">{
    "assertion": "result.ip_permissions_egress|length == 1", 
    "changed": false, 
    "evaluated_to": false, 
    "failed": true
}
</code></pre></div>
<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">core</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.1.0.0 (detached HEAD 5954a82dd6) last updated 2016/05/16 15:32:52 (GMT +300)
  lib/ansible/modules/core: (detached HEAD ce79e7c72d) last updated 2016/05/14 22:47:32 (GMT +300)
  lib/ansible/modules/extras: (detached HEAD 156a8cd0b3) last updated 2016/05/14 22:47:32 (GMT +300)
  config file = /Users/hkariti/repo/bigpanda/playbooks/ansible.cfg
  configured module search path = ['library']"><pre class="notranslate"><code class="notranslate">ansible 2.1.0.0 (detached HEAD 5954a82dd6) last updated 2016/05/16 15:32:52 (GMT +300)
  lib/ansible/modules/core: (detached HEAD ce79e7c72d) last updated 2016/05/14 22:47:32 (GMT +300)
  lib/ansible/modules/extras: (detached HEAD 156a8cd0b3) last updated 2016/05/14 22:47:32 (GMT +300)
  config file = /Users/hkariti/repo/bigpanda/playbooks/ansible.cfg
  configured module search path = ['library']
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="no_cows=True"><pre class="notranslate"><code class="notranslate">no_cows=True
</code></pre></div>
<h5 dir="auto">OS / ENVIRONMENT</h5>

<p dir="auto">N/A</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Suppose we have a role with variables in the <code class="notranslate">vars/</code> dir and that also includes other tasks files from <code class="notranslate">tasks/</code>.</p>
<p dir="auto">When passing argument to roles the following can happen:</p>
<ol dir="auto">
<li>If the role is used directly, the passed value is used correctly.</li>
<li>If the role is a dependency to another role, and the variable is passed to the second role, the variable will be overridden in <code class="notranslate">main.yml</code>, but not on any included files.</li>
<li>Any other calls to the second role with different parameters will not run, as they are detected as duplicated runs.</li>
</ol>
<h5 dir="auto">STEPS TO REPRODUCE</h5>

<p dir="auto">roles/parent/vars/main.yml:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="myvar: default"><pre class="notranslate"><code class="notranslate">myvar: default
</code></pre></div>
<p dir="auto">roles/parent/tasks/main.yml:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: from main
  debug: var=myvar

- include: other.yml"><pre class="notranslate"><code class="notranslate">- name: from main
  debug: var=myvar

- include: other.yml
</code></pre></div>
<p dir="auto">roles/parent/tasks/other.yml:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: from include
  debug: var=myvar"><pre class="notranslate"><code class="notranslate">- name: from include
  debug: var=myvar
</code></pre></div>
<p dir="auto">roles/child1/meta/main.yml:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dependencies:
  - { role: parent, myvar: child_override }"><pre class="notranslate"><code class="notranslate">dependencies:
  - { role: parent, myvar: child_override }
</code></pre></div>
<p dir="auto">roles/child2/meta/main.yml:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dependencies:
  - { role: parent }"><pre class="notranslate"><code class="notranslate">dependencies:
  - { role: parent }
</code></pre></div>
<p dir="auto">cases.yml:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- hosts: localhost
  roles:
# These work as intended:
#    - { role: parent, myvar: play_override } # Case 1
#    - child1 # Case 1 again, now used directly as dependency
# These don't work:
    - { role: child2, myvar: play_override } # Case 2, var is overriden outside include only
    - { role: child2, myvar: play_override2} # Case 3, won't run at all"><pre class="notranslate"><code class="notranslate">- hosts: localhost
  roles:
# These work as intended:
#    - { role: parent, myvar: play_override } # Case 1
#    - child1 # Case 1 again, now used directly as dependency
# These don't work:
    - { role: child2, myvar: play_override } # Case 2, var is overriden outside include only
    - { role: child2, myvar: play_override2} # Case 3, won't run at all
</code></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [parent : from main] ******************************************************
ok: [localhost] =&gt; {
    &quot;myvar&quot;: &quot;play_override&quot;
}

TASK [parent : myvar in include] ***********************************************
ok: [localhost] =&gt; {
    &quot;myvar&quot;: &quot;play_override&quot;
}

TASK [parent : from main] ******************************************************
ok: [localhost] =&gt; {
    &quot;myvar&quot;: &quot;play_override2&quot;
}

TASK [parent : myvar in include] ***********************************************
ok: [localhost] =&gt; {
    &quot;myvar&quot;: &quot;play_override2&quot;
}"><pre class="notranslate"><code class="notranslate">TASK [parent : from main] ******************************************************
ok: [localhost] =&gt; {
    "myvar": "play_override"
}

TASK [parent : myvar in include] ***********************************************
ok: [localhost] =&gt; {
    "myvar": "play_override"
}

TASK [parent : from main] ******************************************************
ok: [localhost] =&gt; {
    "myvar": "play_override2"
}

TASK [parent : myvar in include] ***********************************************
ok: [localhost] =&gt; {
    "myvar": "play_override2"
}
</code></pre></div>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [parent : from main] ******************************************************
ok: [localhost] =&gt; {
    &quot;myvar&quot;: &quot;play_override&quot;
}

TASK [parent : myvar in include] ***********************************************
ok: [localhost] =&gt; {
    &quot;myvar&quot;: &quot;default&quot;
}"><pre class="notranslate"><code class="notranslate">TASK [parent : from main] ******************************************************
ok: [localhost] =&gt; {
    "myvar": "play_override"
}

TASK [parent : myvar in include] ***********************************************
ok: [localhost] =&gt; {
    "myvar": "default"
}
</code></pre></div>