Skip to content
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

Host Unreachable #7

Open
Debojit opened this issue May 30, 2017 · 8 comments
Open

Host Unreachable #7

Debojit opened this issue May 30, 2017 · 8 comments

Comments

@Debojit
Copy link

Debojit commented May 30, 2017

Hi,

I'm running this on macOS 10.12.5, python 2.7.13, ansible 2.3.0.0. I get this error when I try to run the playbook:

$ ansible-playbook playbook.yml -i hosts --ask-pass --become -c paramiko
SSH password:

PLAY [Ansible Playbook for configuring brand new Raspberry Pi] *********************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************************************
fatal: [192.168.1.xxx]: UNREACHABLE! => {"changed": false, "msg": "[Errno None] Unable to connect to port 22 on 192.168.1.xxx", "unreachable": true}
to retry, use: --limit @/Users/[username]/Downloads/ansible-pi/playbook.retry

PLAY RECAP *************************************************************************************************************************************************************************************************
192.168.1.xxx : ok=0 changed=0 unreachable=1 failed=0

@Nishanth-R
Copy link

Hi ,
Facing the same issue : For traceability , I have added the Raspi's ip address in Hosts file, updated the wpa_supplicant.conf file and ran the command. Am I missing something?

@Nishanth-R
Copy link

Figured out what the Issue was , Raspbian switches off SSH by default now and hence this project wont work until you connect to peripherals and enable ssh.

@davidnquach
Copy link

You can just add an ssh file to the boot path

If you want to enable SSH, all you need to do is to put a file called ssh in the /boot/ directory. The contents of the file don’t matter: it can contain any text you like, or even nothing at all. When the Pi boots, it looks for this file; if it finds it, it enables SSH and then deletes the file.

ref: https://www.raspberrypi.org/blog/a-security-update-for-raspbian-pixel/

@Marto32
Copy link

Marto32 commented Jan 31, 2018

the guide that @davidnquach posted worked for me regarding the connection failure, but now I'm getting this error:

{"changed": false, "msg": "host key mismatch for 192.168.1.xxx", "unreachable": true}

Any idea how to rectify this?

I'm not sure what to enter for the SSH Password and SSH Key for your new device prompts.

@davidnquach
Copy link

davidnquach commented Jan 31, 2018

@Marto32

If this is your first time setting up; the default user is pi, and the password is raspberry.

ref: https://www.raspberrypi.org/documentation/linux/usage/users.md

@Marto32
Copy link

Marto32 commented Jan 31, 2018

Thanks @davidnquach. I think the problem is the ssh key prompt. What do you enter for please enter the SSH Key for your new device::?

I've tried blank and the one from my known_hosts file but I keep getting this error now:

fatal: [192.168.1.xxx]: UNREACHABLE! => {"changed": false, "msg": "Authentication failed.", "unreachable": true}

@davidnquach
Copy link

I don't believe I have run into that but have you generated an ssh key for your local machine? Also how are you running the ssh command? ssh [email protected] should just prompt you for the password and another prompt for you to agree that it is a safe machine to log into.

@Marto32
Copy link

Marto32 commented Jan 31, 2018

Got it working - thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants