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
SSH works, but ansible throws unreachable error #15321
Comments
Hi! Thanks very much for your submission to Ansible. It sincerely means a lot to us. We have some questions we'd like to know about before we can get this request queued up. If you can help answer them, we'd greatly appreciate it:
Just as a quick reminder of things, this is a really busy project. We have over 800 contributors and to manage the queue effectively We will definitely see your comments on this issue when reading this ticket, but may not be able to reply promptly. You may also wish to join one of our two mailing lists
Thank you once again for this and your interest in Ansible! |
@mhfowler: I was able to bypass this by providing |
[testServer]
192.168.33.10
[testServer:vars]
ansible_password=vagrant |
This happende all of a sudden when I upgraded Ansible. To successfully run I had to:
Earlier I have only run
Normal SSH with the following works with no issues:
Something has changed. What information can I provide to help debug this? I am running the following:
|
+1 needed to add -c paramiko because one of 5 hosts was failing, and I could ssh into all of them successfully. |
For me, I had an .ssh/config entry for my user to match to the remote hostname.
I could SSH directly to the server with However, with Ansible, I needed to add the
After that, could deploy ok. A little odd it didn't use the .ssh/config file as previously, but the workaround works, thanks :) |
@mhfowler closure has been requested for this issue or it has timed out waiting for your response. |
Why this? I was so happy doing ansible -m ping all now I need to do -u user -c paramiko |
@roolo I also set 'ansible_password' and it began to work for me. What's it for? You can set it to literally anything you want and it will work now. |
Same issue with ansible 2.1.2.0 and --ask-pass option. ohallors fix didn't help. |
I am away from my computer for a few weeks. Pls ping me about this after |
Same.
Using -c paramiko seems to work better, it looks like -c smart is broken. |
In case it helps anyone, I resolved this issue on Ubuntu 16.04 by replacing this line in my hosts file...
with
and then making sure I had added
to my ansible.cfg For me it was simply because I had added the "my_remote_user@" in front of my ip address. This had worked before I upgraded. |
I had the same issue and pinging the host first somehow resolved the issue.
UPD: I have to run ping command almost every time before executing the playbook. As after a couple of minutes of inactivity playbook fails again. |
@cue232s It says to Ansible what password to use for ssh connection. http://docs.ansible.com/ansible/intro_inventory.html#list-of-behavioral-inventory-parameters (looks like the parameter is now called ansible_ssh_pass) |
I resolved a similar issue on Mac OS X with ansible 2.1.2.0 that may help. Not sure where else to post it. I could ssh to the instance, but running my playbook resulted in:
No other error output. But it worked with I downgraded to ansible 1.9.4 (
So I upgraded back to 2.1.2.0 and I added an
And the connection worked. |
I am experiencing the same problem as #15321 (comment)
Interestingly, if I run I'm having the problem on ansible-2.1.2.0 installed with Homebrew on macOS Sierra 10.12.1 Downgrading to 2.1.1.0 eliminates the problem for me. |
I had the same issue
I've resolved it by adding key used to authentication to ssh-agent. The key used by me was without password. |
Having the same issue. Standard OpenSSH attempt fails but paramiko works. Running Ansible inside Vagrant/Virtualbox on Windows to provision remote VMs. Both machines running Ubuntu 16.04. Ansible version 2.1.2.0 Ansible config file is located in /ansible/ansible.cfg. hosts line:
This fails:
This works:
##Solution: Upgraded to Ansible 2.2.0.0 and I no longer have to use -c paramiko |
I had this error, with |
i can connect to my host as root but can not run my ansible
i tried verbose
|
found the solution, ran the following command on my host to fix ssh key folder permission (Centos6.6)
and was able to run setup
|
tried a couple combinations of
and that it doesn't work (without specifying paramiko) with
|
Limiting ssh key permissions to 600 fixed this issue. |
Having the same issue: Error:
when i try to make ansible-playbook -i inventory.ini shsh.yml --key-file ssh/deploy |
How do we solve this at the end of the day? |
edit: it appears the SSH service on my remote machine may have crashed. I tried to start a new ssh session with PuTTY and it closes the connection before the login prompt. edit2: SSH service on the remote machine is indeed not working correctly anymore although I haven't gotten a response as to exactly what the error is yet. Since it happened directly after this Ansible script was run, I'm leaving this here as if an Ansible error caused sshd to crash it may still be related to this issue. Some details for anyone trying to recreate: both target and control machines are intel xeons running CentOS 7. control version is centos-release-7-4.1708.e17.centos.x86_64 with the target having an iris graphics setup. I seem to be having this issue all of a sudden under These were the malformed tasks that failed just before it stopped connecting:
They threw this error:
I copied the error msg from running
Not sure what to make of that, since it'd been working up until now. edit: it appears the SSH service on my remote machine may have crashed. I tried to start a new ssh session with PuTTY and it closes the connection before the login prompt. |
Yeah, I even expect that problem whenever I start using Ansible on a new Mac. That's sad.
|
Just ran into this, only seems to occur on my mac though. |
connection: local in the playbook fixed my problem |
Same error facing: SSH works but ansible throws unreachable error |
@induraj looks like the user that your running ansible with does not have access to the key. |
Thanks for quick response: |
are u running through the virtualenv does that have access to the key? |
yes they have access: |
@induraj I am completely not sure but it could be not getting the right permissions through the virtualenv. |
OK. even i am trying the same, still trying to figure it out. let me share what I have till now.
Could you please help me with accessing the EC2 VM via ansible so that I can move ahead my testing with ansible. |
I have configured on base machine without virtualenv is working. Might be there is some user authentication issue. |
If you ssh-agent has multiple keys use the ansible_ssh_private_key_file variable in your hosts entry to specify your private key instead of ssh-agent passing the wrong key and being rejected. |
List InformationHi! Thanks very much for your interest in Ansible. It sincerely means a lot to us. This appears to be a user question, and we'd like to direct these kinds of things to either the mailing list or the IRC channel.
If you can stop by there, we'd appreciate it. This allows us to keep the issue tracker for bugs, pull requests, RFEs and the like. Thank you once again and we look forward to seeing you on the list or IRC. Thanks! |
In my case the main issue is that the control file was not created and as a result the proxy command did not have proper permissions. Command revealed by adding
If I manually created a route to 10.0.3.* and reran that command without the I mucked around a bit with ForwardAgent options on my host and on the proxy host to no avail. Eventually I just punted and ran that command for each of the failing hosts and let the hack unblock my work. |
I was using a non-standard private key and it wasn't being found. It was 600 perms. |
Adding my key with ssh-copy-id to the remote server fixed the problem. |
adding
More: Getting "UNREACHABLE" error in the midst of role tasks. Would stop on the same task. But would run if I isolated only that task (via tags). |
This comment has been minimized.
This comment has been minimized.
I had the same problem with
I was able to SSH into the hosts manually |
I have the same problem , ubuntu 14.04 with ansible 2.6.2 (upgrade from ansible 1.9)
according to @kararukeys
any suggestions ? please ~ |
|
On OpenSSH_7.9p1, OpenSSL 1.1.1b, ansible 2.7.8, when confronted with the |
ISSUE TYPE
ANSIBLE VERSION
CONFIGURATION
No changes
OS / ENVIRONMENT
OS X El Capitan Version 10.11.3
SUMMARY
I can connect to my Rasberry Pi through ssh through an ethernet cable via "ssh pi@169.254.0.2" but running Ansible with this IP address as a host fails.
I have successfully configured this Rasberry Pi with ansible through wifi (using the wifi IP address), but now trying to use ansible via the direct ethernet connection I get the cryptic error message:
Because I can successfully connect to this pi using that IP address through ssh from terminal, I am positing that this is a bug in Ansible.
STEPS TO REPRODUCE
I run this command to rune the role
I also tried
which lead to the same error.
hosts file
playbook
I assume that the role is actually unimportant because ansible is failing at the ssh connection step.
EXPECTED RESULTS
I expect ansible to connect to pi and run the role (I have successfully done this via connecting over an IP address through wifi)
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: