<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">uri</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.0.0
  config file = /ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.5 (default, Aug  2 2016, 04:20:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]"><pre class="notranslate"><code class="notranslate">ansible 2.3.0.0
  config file = /ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.5 (default, Aug  2 2016, 04:20:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]
</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">Ansible 2.3 just landed in RHEL7, so I just spent the last couple hours chasing down an obscure bug in our infrastructure. Ultimately, I have isolated this issue to the change in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="201715494" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/20427" data-hovercard-type="pull_request" data-hovercard-url="/ansible/ansible/pull/20427/hovercard" href="https://github.com/ansible/ansible/pull/20427">#20427</a>. On it's face, this is a good idea, but the no_log attribute effects everything returned by the module, including the content. It just happened to be that the password appeared in one of our files, so it was replaced with stars and broke the file.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>


<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- uri:
    url: '{{ someFileThatContainsPasswordToDownload }}'
    user: '{{ user }}'
    password: '{{ password }}'
    return_content: yes
  register: result"><pre class="notranslate">- <span class="pl-ent">uri</span>:
    <span class="pl-ent">url</span>: <span class="pl-s"><span class="pl-pds">'</span>{{ someFileThatContainsPasswordToDownload }}<span class="pl-pds">'</span></span>
    <span class="pl-ent">user</span>: <span class="pl-s"><span class="pl-pds">'</span>{{ user }}<span class="pl-pds">'</span></span>
    <span class="pl-ent">password</span>: <span class="pl-s"><span class="pl-pds">'</span>{{ password }}<span class="pl-pds">'</span></span>
    <span class="pl-ent">return_content</span>: <span class="pl-s">yes</span>
  <span class="pl-ent">register</span>: <span class="pl-s">result</span></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">The value of <code class="notranslate">result.content</code> should match the original file on the server.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">All appearances of <code class="notranslate">{{ password }}</code> in <code class="notranslate">{{ someFileThatContainsPasswordToDownload }}</code> are replaced with <code class="notranslate">*</code>, corrupting the value of <code class="notranslate">result.content</code>.</p>
<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>
<p dir="auto">ansible 2.4.0<br>
config file = /home/conductor/playbooks/ansible.cfg<br>
configured module search path = Default w/o overrides<br>
python version = 2.7.12 (default, Jul  1 2016, 15:12:24) [GCC 5.4.0 20160609]</p>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">Not relevant</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Ubuntu 16.04 / Python 2.7</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Ansible display "when statements should not include jinja2 templating" warning while I'm not using jinja2 templating in the when statement.</p>
<p dir="auto">The problem come from the face the variable passed in the when statement references an other variable:</p>
<p dir="auto">in defaults/main.yml</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
my_role_var: &quot;{{ my_host_var }}&quot;
"><pre class="notranslate"><span class="pl-ent">my_role_var</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ my_host_var }}<span class="pl-pds">"</span></span>
</pre></div>
<p dir="auto">in tasks/main.yml</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
- copy: …
  when:  my_role_var
"><pre class="notranslate">- <span class="pl-ent">copy</span>: <span class="pl-s">…</span>
  <span class="pl-ent">when</span>:  <span class="pl-s">my_role_var</span>
</pre></div>
<p dir="auto">[WARNING]: when statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: {{ my_host_var }}</p>
<p dir="auto"><a href="https://github.com/ansible/ansible/files/847733/test.zip">test.zip</a></p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Uncompress the attached project.<br>
Update hosts file and playbook to specify a reachable host.</p>
<p dir="auto">run it using "ansible-playbook -i hosts  playbook.yml"</p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">No warning, or an explanation about what to do about it.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<blockquote>
<p dir="auto">ansible-playbook -i hosts  playbook.yml</p>
</blockquote>
<blockquote>
<p dir="auto">PLAY [*]</p>
<hr>
<p dir="auto">TASK [Gathering Facts]</p>
<hr>
<p dir="auto">ok: [test]</p>
<p dir="auto">TASK [simple : debug]</p>
<hr>
<p dir="auto"><strong>[WARNING]: when statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: {{ hello }}</strong></p>
<p dir="auto">ok: [test] =&gt; {<br>
"changed": false,<br>
"msg": "Hello"<br>
}</p>
<p dir="auto">PLAY RECAP</p>
<hr>
<p dir="auto">test                       : ok=2    changed=0    unreachable=0    failed=0</p>
</blockquote>