Unreachable error

Hi all,

I am new to ansible. I have been learning ansible using ad hoc commands as well as ansible playbooks. Things were running fine until I started getting errors as given below. I have no idea how to resolve these errors. Please help.

navdeep@ansible-master:~$ sudo ansible all -m ping -s -k
SSH password:
127.0.0.1 | UNREACHABLE! => {
“changed”: false,
“msg”: “Authentication failure.”,
“unreachable”: true
}

navdeep@ansible-master:~$ sudo ansible-playbook our-playbook.yml -s -k -K
SSH password:
SUDO password[defaults to SSH password]:

PLAY [local] *******************************************************************

TASK [setup] *******************************************************************
fatal: [127.0.0.1]: UNREACHABLE! => {“changed”: false, “msg”: “Authentication failure.”, “unreachable”: true}
to retry, use: --limit @our-playbook.retry

PLAY RECAP *********************************************************************
127.0.0.1 : ok=0 changed=0 unreachable=1 failed=0

First, check SSH connection. In your case:

ssh 127.0.0.1

I tried to executed ssh 127.0.0.1, It has working, Still am also facing same problem, Please find the below error, Please suggets.

[ansibleCS@ip-172-31-23-238 ansible]$ ansible -m ping remote
ip-172-31-18-69.us-west-2.compute.internal | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).\r\n”,
“unreachable”: true
}

Regards,
Amarnath.