Hi,
Thank you so much , i am able to connect now to remote node after changing 
permissions and using correct syntax in inventory file.

Thank you once again.


On Tuesday, 4 February 2020 18:08:52 UTC+5:30, Stefan Hornburg (Racke) 
wrote:
>
> On 2/4/20 1:36 PM, anilkumar panditi wrote: 
> > Hi Thank you for your reply, 
> > Now i am getting below error. 
> > 
> >     "msg": "Failed to connect to the host via ssh: 
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@      
> >    WARNING: UNPROTECTED PRIVATE KEY FILE!          
> > 
> @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nPermissions
>  
> 0644 for '/home/centos/openshift.pem' 
> > are too open.\r\nIt is required that your private key files are NOT 
> accessible by others.\r\nThis private key will be 
> > ignored.\r\nLoad key \"/home/centos/openshift.pem\": bad 
> permissions\r\nPermission denied 
> > (publickey,gssapi-keyex,gssapi-with-mic).", 
> >     "unreachable": true 
> > 
> > My Inventory := 
> > ============ 
> > hdi_master1 ansible_host=13.234.186.61 ansible_connection=ssh 
> ansible_user=centos 
> > ansible_ssh_private_key_file=/home/centos/openshift.pem 
> > 
> > 
>
> Well, I suppose you can read that error message and fix the permissions !? 
>
> Regards 
>          Racke 
>
> > 
> > 
> > On Tuesday, 4 February 2020 17:49:13 UTC+5:30, Stefan Hornburg (Racke) 
> wrote: 
> > 
> >     On 2/4/20 1:11 PM, anilkumar panditi wrote: 
> >     > Hi , 
> >     >  I am trying to connect to ec2 instance using .pem file in 
> ansible. 
> >     > I am getting below error. 
> >     > 
> >     > fatal: [hdi_master1]: UNREACHABLE! => { 
> >     >     "changed": false, 
> >     >     "msg": "Failed to connect to the host via ssh: Permission 
> denied (publickey,gssapi-keyex,gssapi-with-mic).", 
> >     >     "unreachable": true 
> >     > } 
> >     > 
> >     > my inventory: 
> >     > ============ 
> >     > 
> >     > # inventory of servers 
> >     > 
> >     > #ungrouped servers 
> >     > hdi_master1 ansible_host=13.234.186.61 ansible_connection=ssh 
> ansible_user=centos 
> >     --private-key=/home/centos/openshift.pem 
> >     > 
> >     > even though i am passing i am getting above error .can anyone help 
> me please. 
> > 
> >     Your syntax in the inventory file is bogus, please try 
> > 
> >     ansible_ssh_private_key_file=/home/centos/openshift.pem 
> > 
> >     Regards 
> >              Racke 
> > 
> >     > 
> >     > -- 
> >     > 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] <javascript:> <mailto:
> [email protected] <javascript:> 
> <javascript:>>. 
> >     > To view this discussion on the web visit 
> >     > 
> https://groups.google.com/d/msgid/ansible-project/fb8ec1ed-2346-417b-b056-171d65418f1e%40googlegroups.com
>  
> >     <
> https://groups.google.com/d/msgid/ansible-project/fb8ec1ed-2346-417b-b056-171d65418f1e%40googlegroups.com>
>  
>
> >     > 
> >     <
> https://groups.google.com/d/msgid/ansible-project/fb8ec1ed-2346-417b-b056-171d65418f1e%40googlegroups.com?utm_medium=email&utm_source=footer
>  
> >     <
> https://groups.google.com/d/msgid/ansible-project/fb8ec1ed-2346-417b-b056-171d65418f1e%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>  
>
> > 
> > 
> > 
> >     -- 
> >     Ecommerce and Linux consulting + Perl and web application 
> programming. 
> >     Debian and Sympa administration. Provisioning with Ansible. 
> > 
> > -- 
> > 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] <javascript:> <mailto:
> [email protected] <javascript:>>. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/ansible-project/1ff8ed87-5558-47bb-902c-620c2072db73%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/ansible-project/1ff8ed87-5558-47bb-902c-620c2072db73%40googlegroups.com?utm_medium=email&utm_source=footer>.
>  
>
>
>
> -- 
> Ecommerce and Linux consulting + Perl and web application programming. 
> Debian and Sympa administration. Provisioning with Ansible. 
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/cc93bbe9-8e3c-4adf-af81-1221baedcf66%40googlegroups.com.

Reply via email to