-
Notifications
You must be signed in to change notification settings - Fork 36
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 #6
Comments
Same experience here. Packer version: 1.7.3 |
Same problem here. Packer 1.7.5 That workaround works though. |
Same issue here. The workaround is not business friendly. |
I used this "very dirty" but effective workaround ...
|
@puppetmaster Yes, I used a similar approach. Best solution I found, that pleases business environments, is to build an image with packer first because packer has the ansible provisioner built it, then call that image in my terraform build whether it is AWS, proxmox, vmware etc. Then have ansible scripts set up for any extra needed configuration management. I know this requires more code, but the process is a little smoother. |
I had the same problem recently and I found aws ec2 inventory plugin for ansible could be a solution. I found this from my private repo created 3 years ago, so not sure this is relevant today. working example. |
This issue was originally opened by @guybarzi as hashicorp/packer#10639. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.
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: