From c408bcea31d29cb18489998d9da9eb1ff9819d30 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 8 Jan 2014 17:25:50 -0500 Subject: [PATCH] Update sshpass hostkey error message --- lib/ansible/runner/connection_plugins/ssh.py | 2 +- lib/ansible/runner/connection_plugins/ssh_alt.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/runner/connection_plugins/ssh.py b/lib/ansible/runner/connection_plugins/ssh.py index 43cd1b1b634..ea0857d4061 100644 --- a/lib/ansible/runner/connection_plugins/ssh.py +++ b/lib/ansible/runner/connection_plugins/ssh.py @@ -258,7 +258,7 @@ class Connection(object): if C.HOST_KEY_CHECKING: if ssh_cmd[0] == "sshpass" and p.returncode == 6: - raise errors.AnsibleError('sshpass has exited with error 6. This is typically caused by combining host_key_checking=True and --ask-pass without first adding the hostkey to known_hosts.') + raise errors.AnsibleError('Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this. Please add this host\'s fingerprint to your known_hosts file to manage this host.') controlpersisterror = stderr.find('Bad configuration option: ControlPersist') != -1 or stderr.find('unknown configuration option: ControlPersist') != -1 if p.returncode != 0 and controlpersisterror: diff --git a/lib/ansible/runner/connection_plugins/ssh_alt.py b/lib/ansible/runner/connection_plugins/ssh_alt.py index 7608c0f91be..d987d609a88 100644 --- a/lib/ansible/runner/connection_plugins/ssh_alt.py +++ b/lib/ansible/runner/connection_plugins/ssh_alt.py @@ -297,7 +297,7 @@ class Connection(object): if C.HOST_KEY_CHECKING: if ssh_cmd[0] == "sshpass" and p.returncode == 6: - raise errors.AnsibleError('sshpass has exited with error 6. This is typically caused by combining host_key_checking=True and --ask-pass without first adding the hostkey to known_hosts.') + raise errors.AnsibleError('Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this. Please add this host\'s fingerprint to your known_hosts file to manage this host.') if p.returncode != 0 and controlpersisterror: raise errors.AnsibleError('using -c ssh on certain older ssh versions may not support ControlPersist, set ANSIBLE_SSH_ARGS="" (or ansible_ssh_args in the config file) before running again')