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

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

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

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.4.2.0
  config file = /Users/kevin.ashline/code/DevOps/ansible/ansible.cfg
  configured module search path = [u'/Users/kevin.ashline/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.4.2.0_2/libexec/lib/python2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]"><pre class="notranslate"><code class="notranslate">ansible 2.4.2.0
  config file = /Users/kevin.ashline/code/DevOps/ansible/ansible.cfg
  configured module search path = [u'/Users/kevin.ashline/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.4.2.0_2/libexec/lib/python2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

<p dir="auto">DEFAULT_FORCE_HANDLERS(/Users/kevin.ashline/code/DevOps/ansible/ansible.cfg) = True<br>
DEFAULT_STDOUT_CALLBACK(/Users/kevin.ashline/code/DevOps/ansible/ansible.cfg) = debug<br>
HOST_KEY_CHECKING(/Users/kevin.ashline/code/DevOps/ansible/ansible.cfg) = False<br>
RETRY_FILES_SAVE_PATH(/Users/kevin.ashline/code/DevOps/ansible/ansible.cfg) = /Users/kevin.ashline/code/DevOps/ansible/retry_files</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>

<p dir="auto">macOS High Sierra<br>
Version 10.13.2</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">When attempting to recreate an issue noticed in AWX, I ran:<br>
ansible-inventory --list -i og/hosts<br>
to try to list my inventory file.</p>
<p dir="auto">I did recreate my issue, however the error message I received actually contained my coworkers CORP account password in clear text:</p>
<p dir="auto">ERROR! Unexpected Exception, this is probably a bug: Cannot json serialize <em>corp password here</em></p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>

<p dir="auto">Have a .yml in your host file directory which contains a vault encrypted string.  Run the above command targeting your inventory file.</p>
<p dir="auto">Based on my testing it's literally any vault encrypted strings and my coworker was unlucky enough that the first string encountered was his corp password.</p>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible-inventory --list -i hosts"><pre class="notranslate"><code class="notranslate">ansible-inventory --list -i hosts
</code></pre></div>

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

<p dir="auto">list my inventory the way ansible sees it</p>
<h5 dir="auto">ACTUAL RESULTS</h5>

<p dir="auto">unsecured coworker</p>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR! Unexpected Exception, this is probably a bug: Cannot json serialize *corp password here*"><pre class="notranslate"><code class="notranslate">ERROR! Unexpected Exception, this is probably a bug: Cannot json serialize *corp password here*
</code></pre></div>
<p dir="auto">If only newline symbol was added/removed, output of --diff mode may be confusing for user:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK: [common | install /etc/timezone] **************************************** 
--- before: /etc/timezone
+++ after: /tmp/tmpuzXAH7
@@ -1 +1 @@
-Asia/Baghdad
+Asia/Baghdad
changed: [redmine]"><pre class="notranslate"><code class="notranslate">TASK: [common | install /etc/timezone] **************************************** 
--- before: /etc/timezone
+++ after: /tmp/tmpuzXAH7
@@ -1 +1 @@
-Asia/Baghdad
+Asia/Baghdad
changed: [redmine]
</code></pre></div>
<p dir="auto">This leads to problems like this: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="121059531" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/13476" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/13476/hovercard" href="https://github.com/ansible/ansible/issues/13476">#13476</a> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="39477600" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/8443" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/8443/hovercard" href="https://github.com/ansible/ansible/issues/8443">#8443</a></p>
<p dir="auto">I think, it would be more convenient and error-prone to explicitly mark newline add/remove in --diff output, like <code class="notranslate">git diff</code> does.</p>