What Do You Do If You Run an Ansible Command and You Receive an Error “Failed to connect to the host via ssh: OpenSSH_6.6.1, OpenSSL 1.0.1e”?

Problem scenario
You run an Ansible command.  But you get an error like this:

" UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: OpenSSH_6.6.1, OpenSSL 1.0.1e
-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56:"

What should you do?

Solution
On the Ansible control server find the ansible.cfg file (find / -name ansible.cfg).  If you not using Mac OS, this stanza should not be in your ansible.cfg file:

control_path = ~/.ssh/ansible-ssh-%%C

Comment out the above stanza if you are using Ansible on Linux (e.g., Linux SUSE or a RedHat or Debian derivative).  Then run your ansible command.  The problem should be fixed.  

The root cause is that "~/.ssh/ansible-ssh-%%C" is appropriate for MacOS deployments of Ansible and not regular Linux.

Leave a comment

Your email address will not be published. Required fields are marked *