-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ansible Can't SSH When SSH Communicator Uses Password #10639
Comments
What version of Packer are you on? Of Ansible? I'd have expected #9350 to address this but maybe it wasn't enough for older versions of ansible that still use the ansible_ssh_pass flag, which I think was prior to ansible v2.0 |
Packer version: 1.6.6 Anyway, shouldn't packer ansible provisioner be able to establish an SSH connection without "manual" interference even when the user passes the SSH communicator a password instead of an SSH key file? Thanks in advance! |
For clarification: When I use the |
You're right, ideally this should work automatically. |
This issue has been automatically migrated to hashicorp/packer-plugin-ansible#6 because it looks like an issue with that plugin. If you believe this is not an issue with the plugin, please reply to hashicorp/packer-plugin-ansible#6. |
Just wanted to comment to say I have been having this problem on RHEL and Windows. I thought it was something in my environment, and switched to other ways of doing auth. (just using a private key to connect). But, this compounded with the RHEL 8.* SSH (#8609) issue, made the solution I use for other OSs, not work. |
I will open another issue after some more troubleshooting. But, I'm also having an issue using the ssh_authorized_key_file property, it still generates the key which is empty, and does not pass the value in ssh_authorized_key_file. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Hi,
I'm trying to provision an Ubuntu 18.04.5 machine with ansible provisioner after building it with vsphere-iso.
However, Ansible can't SSH to the machine, it prompts the following error:
fatal: [default]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '10.0.0.1' (ECDSA) to the list of known hosts.\r\nLoad key \"/tmp/ansible-key305487509\": invalid format\r\nuser@10.0.0.1: Permission denied (publickey,password).\r\n", "unreachable": true}
After looking into the problem a little bit, it seems that the problem is that the key file created is empty. I do use the
ssh_password
for the SSH communicator instead of a key file. When I insertansible_ssh_pass
as an extra argument for ansible, everything works. However, I think it should work automatically, even withssh_password
.I would appreciate help in fixing this issue or telling me what I did wrong if the problem is on my end.
Here is the configuration associated with the issue:
Thanks in advance!
The text was updated successfully, but these errors were encountered: