<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 (devel 3b80f63e22) last updated 2014/12/05 14:09:09 (GMT +1000)
  lib/ansible/modules/core: (ec2_snapshot_remove b287e7c0a6) last updated 2014/12/02 11:18:53 (GMT +1000)
  lib/ansible/modules/extras: (detached HEAD 7e6fc7023d) last updated 2014/11/05 11:09:14 (GMT +1000)
  v2/ansible/modules/core: (detached HEAD cb69744bce) last updated 2014/11/05 11:09:23 (GMT +1000)
  v2/ansible/modules/extras: (detached HEAD 8a4f07eecd) last updated 2014/11/05 11:09:31 (GMT +1000)
  configured module search path = None"><pre class="notranslate"><code class="notranslate">ansible 1.9 (devel 3b80f63e22) last updated 2014/12/05 14:09:09 (GMT +1000)
  lib/ansible/modules/core: (ec2_snapshot_remove b287e7c0a6) last updated 2014/12/02 11:18:53 (GMT +1000)
  lib/ansible/modules/extras: (detached HEAD 7e6fc7023d) last updated 2014/11/05 11:09:14 (GMT +1000)
  v2/ansible/modules/core: (detached HEAD cb69744bce) last updated 2014/11/05 11:09:23 (GMT +1000)
  v2/ansible/modules/extras: (detached HEAD 8a4f07eecd) last updated 2014/11/05 11:09:31 (GMT +1000)
  configured module search path = None
</code></pre></div>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Fedora 21</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">You cannot use <code class="notranslate">inventory_dir</code> with <code class="notranslate">vars_files</code> - it's just not available to the <code class="notranslate">_update_vars_files</code> method.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
---
- hosts: localhost

  vars_files:
    - &quot;{{included}}&quot;

  tasks:
    - debug: msg=&quot;{{included}}&quot;
    - debug: msg=&quot;{{inventory_dir}}&quot;
    - debug: msg=&quot;{{hello}}&quot;"><pre class="notranslate"><code class="notranslate">
---
- hosts: localhost

  vars_files:
    - "{{included}}"

  tasks:
    - debug: msg="{{included}}"
    - debug: msg="{{inventory_dir}}"
    - debug: msg="{{hello}}"
</code></pre></div>
<p dir="auto">run with <code class="notranslate">ansible-playbook -i ~/hosts</code> and <code class="notranslate">~/files/hello</code> containing:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="hello: world"><pre class="notranslate"><code class="notranslate">hello: world
</code></pre></div>
<p dir="auto">and <code class="notranslate">~/group_vars/all.yml</code> containing <code class="notranslate">included: "{{inventory_dir}}/files/hello</code><br>
shows that <code class="notranslate">inventory_dir</code> is correctly set but <code class="notranslate">hello</code> which should be set by <code class="notranslate">files/hello</code> is never set.</p>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto"><code class="notranslate">vars_files</code> should be able to expand <code class="notranslate">inventory_dir</code></p>
<h5 dir="auto">Actual Results:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [localhost] ************************************************************** 

GATHERING FACTS *************************************************************** 
ok: [localhost]

TASK: [debug msg=&quot;{{included}}&quot;] ********************************************** 
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;/home/will/files/hello&quot;
}

TASK: [debug msg=&quot;/home/will&quot;] ********************************************* 
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;/home/will&quot;
}

TASK: [debug msg=&quot;{{hello}}&quot;] ************************************************* 
fatal: [localhost] =&gt; One or more undefined variables: 'hello' is undefined

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/home/will/vars_files.retry
"><pre class="notranslate"><code class="notranslate">PLAY [localhost] ************************************************************** 

GATHERING FACTS *************************************************************** 
ok: [localhost]

TASK: [debug msg="{{included}}"] ********************************************** 
ok: [localhost] =&gt; {
    "msg": "/home/will/files/hello"
}

TASK: [debug msg="/home/will"] ********************************************* 
ok: [localhost] =&gt; {
    "msg": "/home/will"
}

TASK: [debug msg="{{hello}}"] ************************************************* 
fatal: [localhost] =&gt; One or more undefined variables: 'hello' is undefined

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/home/will/vars_files.retry

</code></pre></div>
<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Documentation Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>

<p dir="auto">os_subnet</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.1.0"><pre class="notranslate"><code class="notranslate">ansible 2.2.1.0
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

<p dir="auto">N/A</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>

<p dir="auto">N/A</p>
<h5 dir="auto">SUMMARY</h5>

<p dir="auto">Several of the Openstack os_* modules (e.g <a href="http://docs.ansible.com/ansible/os_subnet_module.html" rel="nofollow">http://docs.ansible.com/ansible/os_subnet_module.html</a>) reports two different python versions as requirements:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="python &gt;= 2.6
python &gt;= 2.7
shade"><pre class="notranslate"><code class="notranslate">python &gt;= 2.6
python &gt;= 2.7
shade
</code></pre></div>
<p dir="auto">Looking in module <code class="notranslate">os_subnet.py</code> I can see that it only has these specified:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="requirements:
    - &quot;python &gt;= 2.6&quot;
    - &quot;shade&quot;"><pre class="notranslate"><code class="notranslate">requirements:
    - "python &gt;= 2.6"
    - "shade"
</code></pre></div>
<p dir="auto">So I guess the requirement <code class="notranslate">python &gt;= 2.7</code> is automagically picked up somehow.<br>
Is the correct way to fix this to remove the item <code class="notranslate">python &gt;= 2.6</code> from requirements list?<br>
If so I can send PRs for that.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>

<p dir="auto">N/A</p>

<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"></pre></div>

<h5 dir="auto">EXPECTED RESULTS</h5>

<p dir="auto">N/A</p>
<h5 dir="auto">ACTUAL RESULTS</h5>


<p dir="auto">N/A</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate">
</code></pre></div>