<h5 dir="auto">ISSUE TYPE</h5>

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

<p dir="auto">ansible-vault</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ansible --version
ansible 2.3.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.13 (default, Feb 11 2017, 12:22:40) [GCC 6.3.1 20170109]"><pre class="notranslate"><code class="notranslate">$ ansible --version
ansible 2.3.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.13 (default, Feb 11 2017, 12:22:40) [GCC 6.3.1 20170109]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">None</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Ansible vault no longer writes to stdout correctly.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ echo secret | ansible-vault encrypt --vault-password-file=~/.vault_password_file --output=-"><pre class="notranslate">$ <span class="pl-c1">echo</span> secret <span class="pl-k">|</span> ansible-vault encrypt --vault-password-file=<span class="pl-k">~</span>/.vault_password_file --output=-</pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ANSIBLE_VAULT;1.1;AES256
37633461343236623465393564643231623135316432653433333663653262336633356261393433
6135343866303138623931303030343635616331393664650a663233383839356430623338376332
61666238356539323562373538376133626265363234343264633565666332646331366130363766
6533353966343463340a623562366464383334663066376461366536633764393761643635656261
3736
Encryption successful"><pre class="notranslate"><code class="notranslate">$ANSIBLE_VAULT;1.1;AES256
37633461343236623465393564643231623135316432653433333663653262336633356261393433
6135343866303138623931303030343635616331393664650a663233383839356430623338376332
61666238356539323562373538376133626265363234343264633565666332646331366130363766
6533353966343463340a623562366464383334663066376461366536633764393761643635656261
3736
Encryption successful
</code></pre></div>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR! [Errno 2] No such file or directory: '/home/notroot/-'"><pre class="notranslate"><code class="notranslate">ERROR! [Errno 2] No such file or directory: '/home/notroot/-'
</code></pre></div>
<p dir="auto">I have this in my task file:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: Check if we already have an openvpn key file
  stat: &quot;path='/etc/openvpn/{{ vpn_domain }}.conf'&quot;
  register: openvpn_config

- include: &quot;openvpn-genkey.yml&quot;
  when: openvpn_config.stat.exists == False"><pre class="notranslate"><code class="notranslate">- name: Check if we already have an openvpn key file
  stat: "path='/etc/openvpn/{{ vpn_domain }}.conf'"
  register: openvpn_config

- include: "openvpn-genkey.yml"
  when: openvpn_config.stat.exists == False
</code></pre></div>
<p dir="auto">However, I see this output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="time ansible-playbook --forks=20 timeboxes.yml --limit guardhome1 --tag timeagent

PLAY ***************************************************************************

TASK [setup] *******************************************************************
ok: [guardhome1 -&gt; localhost]

TASK [common : include] ********************************************************
included: user.yml for guardhome1

TASK [common : include] ********************************************************
included: apt.yml for guardhome1

... MORE OUTPUT HERE ...

TASK [timebox : include] *******************************************************
fatal: [guardhome1]: FAILED! =&gt; {&quot;failed&quot;: true, &quot;msg&quot;: &quot;ERROR! The conditional check 'openvpn_config.stat.exists == False' failed. The error was: ERROR! error while evaluating conditional: openvpn_config.stat.exists == False ({% if openvpn_config.stat.exists == False %} True {% else %} False {% endif %})&quot;}

PLAY RECAP *********************************************************************
guardhome1                 : ok=19   changed=0    unreachable=0    failed=1   "><pre class="notranslate"><code class="notranslate">time ansible-playbook --forks=20 timeboxes.yml --limit guardhome1 --tag timeagent

PLAY ***************************************************************************

TASK [setup] *******************************************************************
ok: [guardhome1 -&gt; localhost]

TASK [common : include] ********************************************************
included: user.yml for guardhome1

TASK [common : include] ********************************************************
included: apt.yml for guardhome1

... MORE OUTPUT HERE ...

TASK [timebox : include] *******************************************************
fatal: [guardhome1]: FAILED! =&gt; {"failed": true, "msg": "ERROR! The conditional check 'openvpn_config.stat.exists == False' failed. The error was: ERROR! error while evaluating conditional: openvpn_config.stat.exists == False ({% if openvpn_config.stat.exists == False %} True {% else %} False {% endif %})"}

PLAY RECAP *********************************************************************
guardhome1                 : ok=19   changed=0    unreachable=0    failed=1   
</code></pre></div>
<p dir="auto">I'm using latest Ansible from git.</p>