<p dir="auto">Issue Type: Bug Report<br>
Ansible Version: ansible 2.0.0 (devel <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible/commit/b2a9111b22dcd9662c0ae1537913a810e70b5c5c/hovercard" href="https://github.com/ansible/ansible/commit/b2a9111b22dcd9662c0ae1537913a810e70b5c5c"><tt>b2a9111</tt></a>) last updated 2015/11/11 15:03:24 (GMT +200)<br>
Environment: Ubuntu 15.04<br>
Summary: Ansible will not copy but move a file when called with force=no and remote_src=true<br>
Steps to reproduce:</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="copy: src=/usr/share/php5/php.ini-production dest=/tmp/test.conf remote_src=true"><pre class="notranslate"><span class="pl-ent">copy</span>: <span class="pl-s">src=/usr/share/php5/php.ini-production dest=/tmp/test.conf remote_src=true</span></pre></div>
<p dir="auto">Expected Result: <em>/usr/share/php5/php.ini-production</em> will be <strong>copied</strong> to <em>/tmp/test.conf</em></p>
<p dir="auto">Actual Result: <em>/usr/share/php5/php.ini-production</em> will be <strong>moved</strong> to <em>/tmp/test.conf</em>; source file is removed. Ansible will fail when source file system is read-only as it cannot remove the file (/usr is mounted read-only in this example):</p>
<p dir="auto"><code class="notranslate">fatal: [removed]: FAILED! =&gt; {"changed": false, "failed": true, "msg": "{\"msg\": \"Could not replace file: /usr/share/php5/php.ini-production to /tmp/test.conf: [Errno 30] Read-only file system: '/usr/share/php5/php.ini-production'\", \"failed\": true}\r\nException OSError: (2, 'No such file or directory', '/tmp/.ansible_tmp8zPmHVtest.conf') in &lt;bound method _TemporaryFileWrapper.__del__ of &lt;closed file '&lt;fdopen&gt;', mode 'w+b' at 0x7f241188c4b0&gt;&gt; ignored\r\n", "parsed": false}</code></p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
<li>Feature Idea</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">AWS EC2 External Inventory Script</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Switching the <code class="notranslate">AWS_PROFILE</code> does not invalidate the cache. So its possible to load inventory from one AWS profile and then switch to another and have the same results.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">AWS_PROFILE=staging ec2.py --list<br>
AWS_PROFILE=staging ec2.py --list</p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Two different lists of resources</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">Duplicate list of resources</p>