hello,

im new to ansible.
im trying to ping host machine but i got error,



UNREACHABLE! => {
    "changed": false, 
    "msg": "Failed to connect to the host via ssh: Permission denied 
(publickey,gssapi-keyex,gssapi-with-mic,password).", 
    "unreachable": true
}


but im able to connect using ssh.

On Monday, November 13, 2017 at 9:22:31 AM UTC+5:30, [email protected] 
wrote:
>
> Hello All,
>
> Just new to Ansible and trying to implement in our organozation. 
>
> Noticed this, 
>
>
> When ran ping from root user prompt by mentioning "delpoy" user , it 
> errors out.
>
> ++++++++++++++++++++++++++++++++++
> [root@dev-armor21 ~]# ansible all -m ping --user=delpoy
> dev-mado21 | 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
> }
> dev-pipe21 | 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
> }
> dev-mado22 | 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
> }
> localhost | SUCCESS => {
>     "changed": false,
>     "ping": "pong"
> }
> ++++++++++++++++++++++++++++++++++
>
>
> But when switch to deploy user and run ansible ping , it works fine 
>
>
>
> ++++++++++++++++++++++++++++++++++
> [root@dev-armor21 ~]# su - deploy
> [deploy@dev-armor21 ~]$ ansible all  -m ping
> localhost | SUCCESS => {
>     "changed": false,
>     "ping": "pong"
> }
> dev-mado22 | SUCCESS => {
>     "changed": false,
>     "ping": "pong"
> }
> dev-pipe21 | SUCCESS => {
>     "changed": false,
>     "ping": "pong"
> }
> dev-mado21 | SUCCESS => {
>     "changed": false,
>     "ping": "pong"
> }
> [deploy@dev-armor21 ~]$
> ++++++++++++++++++++++++++++++++++
>
> Is this expected or am I doing something wrong?
>
> My objective is to run ansible command from root ( do not want to share 
> root keys to all hosts ) and with specific users .
>
> Can this be achieved?
>
> Regards,
> Prakash.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5516a357-7b3e-4e58-9887-1628dc443098%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to