ansible-for-devops
ansible-for-devops copied to clipboard
Running your first Ad-Hoc Ansible command - missing ssh key or password
Trying to follow "Running your first Ad-Hoc Ansible command" gets an error because you have not given a password or set up an ssh key to the remote host.
Reading on, I see that you talk about this at length. But only AFTER the error has occurred, and users like me have gone back, reread the section, double-checked our work, and filed a bug report. Please, a heads up ahead of time would have saved a lot of wasted time and effort.
Reading on, I see that you talk about this at length. But only AFTER the error has occurred, and users like me have gone back, reread the section, double-checked our work, and filed a bug report. Please, a heads up ahead of time would have saved a lot of wasted time and effort.
Dude, yea. I just spent an hour and half trying to figure this one out
I don't see a problem in the "Running your first Ad-Hoc Ansible Command". There is no need to provide password or setup SSH Key BECAUSE of the private-key SSH authentication of vagrant user.
ansible_ssh_private_key_file: ~/.vagrant.d/insecure_private_key
The above line placed in the inventory should not prompt for password.
If you still see issues, please paste the error here.
This was probably my biggest lesson in the last 5 years. It took me 7 straight hours for me to figure out that it was an ssh issue.
If it's the issue I went through, the machine cannot ssh into itself. Add the private key into your .ssh directory, and rename it "id_rsa"