Ansible ping all error


#1

i have setup and configured as per the https://rak8s.io/ but when i run ansible -m ping all i get error, however all the Raspberry nodes i can do ssh with user “pi” and even my private key but this erorr keep coming

ansible -m ping all

rak8s001 | UNREACHABLE! => {

"changed": false,

"msg": “SSH Error: data could not be sent to remote host “rak8s001”. Make sure this host can be reached over ssh”,

"unreachable": true

}

rak8s000 | UNREACHABLE! => {

"changed": false,

"msg": “SSH Error: data could not be sent to remote host “rak8s000”. Make sure this host can be reached over ssh”,

"unreachable": true

}


any idea


#2

Hi there. Have you copied your ssh public keys over to your pis? If not, that’s the first place I’d start.

ssh-copy-id -I /path/to/your/pubkey

Should do the trick.

If not, standard Linux troubleshooting steps apply. Do a netstat to confirm the Pis are listening on :22, netcat to the pis from your control node to see if a connection can be made, check your firewall.


#3

yes, i copied and i can ssh to PIS. ? with user “PI” , so this is the strange thig …


#4

i can do ssh pi@hostname and it goes without password because the PI has /home/pi/.ssh/authorized_keys data matching to my id_rsa.pub file.


#5

no luck…i checked…i can do ssh …i had my id_rsa.pub file copied before what you said (ssh-copy-id procedure)


#6

What does your inventory look like? Where are you running the command from? Can you provide some output of what you’re seeing?


#7

here is my inventory (hosts.ini) and i am running from this path
/Users/rushi/devops/kubespray/
i have the id_rsa.pub and all the ansible files in this folder.

lvkubadm1.pal.xxx.corp ansible_host=10.48.xxx.171
lvkubadm2.pal.xxx.corp ansible_host=10.48.xxx.72
lvkubadm3.pal.xxx.corp ansible_host=10.48.xxx…63
lvkubadm4.pal.xxx.corp ansible_host=10.48.xxx.104


#8

only one host giving trouble and other 3 hosts have no issue.


#9

does it because of any python install on PI …i am reading this link and they all talking about something https://www.jeffgeerling.com/blog/2018/fixing-unreachable-ssh-error-when-running-ansible-playbooks-against-ubuntu-1804-or-1604