chris-short / rak8s

Stand up a Raspberry Pi based Kubernetes cluster with Ansible
MIT License
365 stars 112 forks source link

Cannot ping all nodes #14

Closed aaronpkelly closed 6 years ago

aaronpkelly commented 6 years ago

ansible -m ping all fails after adding my nodes to my inventory file:

black | UNREACHABLE! => { "changed": false, "msg": "SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh", "unreachable": true }

I had to put ansible_ssh_pass=PASSWORD in my inventory file, and install "sshpass" for this task to succeed

LoganAvatar commented 6 years ago

I faced this same thing, and used ansible-playbook --ask-pass cluster.yml to make it work

HannanSolo commented 6 years ago

You can also make it work by adding your host computer's pub key to each pi. I recommend it because it makes everything easier.

asachs01 commented 6 years ago

+1 to @HannanSolo 's recommendation. I don't know that this is an issue w/ rak8s so much as it is a workflow w/ Ansible thing.

chris-short commented 6 years ago

There are a couple solutions to this. All of them Ansible (or more accurately, SSH) related:

  1. Use ssh-copy-id utility on all nodes to distribute your SSH public key
  2. Copy your public key manually to each node
  3. Use --ask-pass flag

@aaronpkelly I strongly encourage you not to write systems' passwords to disk (ie putting them in your inventory file). If you have committed this to git, it's in your history and would need to be scrubbed.