<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 2.4.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/hymie/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.6.6 (r266:84292, Aug  9 2016, 06:11:56) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]"><pre class="notranslate"><code class="notranslate">ansible 2.4.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/hymie/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.6.6 (r266:84292, Aug  9 2016, 06:11:56) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="DEFAULT_VAULT_PASSWORD_FILE(/root/ansible.password.change/ansible.cfg) = /usr/local/bin/redactedprogram"><pre class="notranslate"><code class="notranslate">DEFAULT_VAULT_PASSWORD_FILE(/root/ansible.password.change/ansible.cfg) = /usr/local/bin/redactedprogram
</code></pre></div>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Red Hat Enterprise Linux Workstation release 6.9 (Santiago)</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">My <code class="notranslate">ansible.cfg</code> file specifies a default vault password.  I am unable to override this with a different vault password.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ cat ansible.cfg
[defaults]
vault_password_file = /usr/local/bin/redactedprogram


$ echo &quot;hi there&quot; |  ansible-vault encrypt_string --ask-vault-pass
New Vault password:
Confirm New Vault password:
ERROR! Only one --vault-id can be used for encryption. This includes passwords from configuration and cli.

$ echo &quot;hi there&quot; |  ansible-vault encrypt_string --vault-password-file=/tmp/foo
ERROR! Only one --vault-id can be used for encryption. This includes passwords from configuration and cli.

$ echo &quot;hi there&quot; |  ansible-vault encrypt_string --vault-id=@prompt
New vault password (default):
Confirm vew vault password (default):
ERROR! Only one --vault-id can be used for encryption. This includes passwords from configuration and cli."><pre class="notranslate"><code class="notranslate">$ cat ansible.cfg
[defaults]
vault_password_file = /usr/local/bin/redactedprogram


$ echo "hi there" |  ansible-vault encrypt_string --ask-vault-pass
New Vault password:
Confirm New Vault password:
ERROR! Only one --vault-id can be used for encryption. This includes passwords from configuration and cli.

$ echo "hi there" |  ansible-vault encrypt_string --vault-password-file=/tmp/foo
ERROR! Only one --vault-id can be used for encryption. This includes passwords from configuration and cli.

$ echo "hi there" |  ansible-vault encrypt_string --vault-id=@prompt
New vault password (default):
Confirm vew vault password (default):
ERROR! Only one --vault-id can be used for encryption. This includes passwords from configuration and cli.
</code></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">I expect the supplied command-line options to override the configuration file defaults and specify (or allow me to specify) the encryption password.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">I get the above errors that the pre-configured default vault-id cannot be replaced.</p>
<h5 dir="auto">Issue Type:</h5>
<p dir="auto">“Bug Report”</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">ansible 1.7 (devel <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible/commit/05eb6aacec2ee1bdb1318587d4a183d1e5f92019/hovercard" href="https://github.com/ansible/ansible/commit/05eb6aacec2ee1bdb1318587d4a183d1e5f92019"><tt>05eb6aa</tt></a>) last updated 2014/06/26 13:36:36 (GMT +000)</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Centos 5/6</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">when using git module, if ssh://git@192.168.1.89:1357/, the host check process breaks.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<ol dir="auto">
<li>have a git repo available over ssh on port 22</li>
<li>have a working git checkout with ssh://git@fqdn/</li>
<li>try with ssh://git@fqdn:22/</li>
</ol>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">It should work as expected, on port 22 and on non-standard ports.</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">(let me add that the host key IS in known_hosts)</p>
<p dir="auto">with accept_hostkey = False</p>
<p dir="auto">failed: [127.0.0.1] =&gt; (item=..) =&gt; {"failed": true, "item": ".."}<br>
msg: 192.168.1.89:22 has an unknown hostkey. Set accept_hostkey to True or manually add the hostkey prior to running the git module</p>
<p dir="auto">with accept_hostkey = True</p>
<p dir="auto">failed: [127.0.0.1] =&gt; (item=..) =&gt; {"failed": true, "item": ".."}<br>
msg: failed to add 192.168.1.89:22 hostkey: getaddrinfo 192.168.1.89:22: Name or service not known</p>
<p dir="auto">The problem seems to come from ansiwork/lib/ansible/module_utils/known_hosts.py<br>
get_fqdn does not remove the port.</p>