<h5 dir="auto">Issue Type: Bug Report</h5>
<h5 dir="auto">Ansible Version:  1.8.2</h5>
<h5 dir="auto">Environment:  RHEL 6.5</h5>
<h5 dir="auto">Summary:</h5>
<p dir="auto">For some reason the "copy" module bombs out if lookup('file', '...') is referenced in group_vars, even though the "copy" task itself does not reference that variable, and the file does exist relative to the role directory.</p>
<h5 dir="auto">Steps to reproduce:</h5>
<p dir="auto">Please see this gist:  <a href="https://gist.github.com/tgolly/930dce54307139f9c758">https://gist.github.com/tgolly/930dce54307139f9c758</a></p>
<p dir="auto">You'll see that "authorized_key" tasks successfully references the "listofkeys" variable and deploys the file, then the "file" and "stat" tasks both work without error, then "copy" bombs out, even though it doesn't reference the "listofkeys" variable from group_vars/all.</p>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">The file is copied without error.</p>
<h5 dir="auto">Actual Results:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK: [myrole | copy src=/etc/hosts dest=/tmp/foo] ****************************
fatal: [localhost] =&gt; could not locate file in lookup: public_keys/somekey"><pre class="notranslate"><code class="notranslate">TASK: [myrole | copy src=/etc/hosts dest=/tmp/foo] ****************************
fatal: [localhost] =&gt; could not locate file in lookup: public_keys/somekey
</code></pre></div>
<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Bug</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">ansible 1.8.2</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">debian 7 / gentoo</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">The copy and template modules throws an error with a wrong file.<br>
In ansible 1.7.x everything is fine and ansible copies the jail.conf.<br>
In ansible 1.8.2 i cannot copy any file while i have a lookup defined in group vars. Even if the defined lookup is not used in any playbook</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">group_vars/all</p>
<p dir="auto">ssh_users:</p>
<ul dir="auto">
<li>
<p dir="auto">name: evo</p>
<p dir="auto">key: "{{ lookup('file', 'evo.pub') }}"</p>
</li>
</ul>
<p dir="auto">tasks/main.yml</p>
<ul dir="auto">
<li>
<p dir="auto">name: copy fail2ban config</p>
<p dir="auto">copy: src=jail.conf dest=/etc/fail2ban/jail.conf</p>
</li>
</ul>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">ansible 1.7.x</p>
<p dir="auto">TASK: [common-j | copy fail2ban config] ************************************<br>
changed: [evosrv.test]</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">ansible 1.8.2</p>
<p dir="auto">TASK: [common-j | copy fail2ban config] ************************************<br>
fatal: [evosrv.test] =&gt; could not locate file in lookup: evo.pub</p>