Skip to content

Commit

Permalink
Update sshpass hostkey error message
Browse files Browse the repository at this point in the history
  • Loading branch information
jctanner committed Jan 8, 2014
1 parent 0b64408 commit c408bce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ansible/runner/connection_plugins/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def exec_command(self, cmd, tmp_path, sudo_user,sudoable=False, executable='/bin

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:
Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/runner/connection_plugins/ssh_alt.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def exec_command(self, cmd, tmp_path, sudo_user,sudoable=False, executable='/bin

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')
Expand Down

0 comments on commit c408bce

Please sign in to comment.