Re: [ansible-project] ansible fail to work with ssh

2019-03-19 Thread Amit Bhardwaj
Check this link ->
https://www.reddit.com/r/ansible/comments/3wetnm/i_can_ssh_why_cant_i_ansible/
and see if that works.

In case it fails, we would like to know more about the setup like Ansible
version, OS details on Ansible server and client, does it work fine with
any other client or is it the same? If it works fine with another client,
the issue can be limited to that particular client and not ANSIBLE as a
whole. This is a very very basic setup so it should work perfectly fine.

Regards
AB

On Tue, Mar 19, 2019 at 3:41 PM  wrote:

> I can do ssh to second server without issue with the same user but I'm
> getting this error when I ran the ansible command
>
>
> On Tuesday, March 19, 2019 at 10:03:04 AM UTC, tharan...@gmail.com wrote:
>>
>> Hi Amit,
>> Thanks as I mention in my problem
>> if I gave value for "ansible_ssh_pass= it works , But I don't like to do
>> that.
>>
>>
>> On Tuesday, March 19, 2019 at 9:49:31 AM UTC, Amit Bhardwaj wrote:
>>>
>>> Check if this link helps:
>>> https://stackoverflow.com/questions/42421774/ansible-permission-problems
>>>
>>> Surely some permission issue here.
>>>
>>> On Tuesday, March 19, 2019 at 3:14:38 PM UTC+5:30, tharan...@gmail.com
>>> wrote:


 Is this the same user you use for normal ssh?
 yes.

 On Tuesday, March 19, 2019 at 9:25:55 AM UTC, Sebastian Meyer wrote:
>
> On 19.03.19 09:18, tharan...@gmail.com wrote:
> >ansible_user= host=
>
> Is this the same user you use for normal ssh? When you did the
> ssh-copy-id you transferred the public key to the remote node only for
> a
> single user (I'm guessing root, as you were root on the control node
> and
> did not specify a user there). If that user is different from the one
> you use for ansible, then the key can't be used.
>
> - Sebastian
>
> --
> Sebastian Meyer
> Linux Consultant & Trainer
> Mail: me...@b1-systems.de
>
> B1 Systems GmbH
> Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
> GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
>
 --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/d04a0aff-1595-4720-b60a-271dfe143ac8%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Regards,
AB

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAKs7jXJsNUSDdzbuvf%2B8vwOdv8qJAytCATXo5TskjeU5g9Gu9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible fail to work with ssh

2019-03-19 Thread tharanga2006
I can do ssh to second server without issue with the same user but I'm 
getting this error when I ran the ansible command


On Tuesday, March 19, 2019 at 10:03:04 AM UTC, tharan...@gmail.com wrote:
>
> Hi Amit,
> Thanks as I mention in my problem
> if I gave value for "ansible_ssh_pass= it works , But I don't like to do 
> that.
>
>
> On Tuesday, March 19, 2019 at 9:49:31 AM UTC, Amit Bhardwaj wrote:
>>
>> Check if this link helps: 
>> https://stackoverflow.com/questions/42421774/ansible-permission-problems
>>
>> Surely some permission issue here. 
>>
>> On Tuesday, March 19, 2019 at 3:14:38 PM UTC+5:30, tharan...@gmail.com 
>> wrote:
>>>
>>>
>>> Is this the same user you use for normal ssh? 
>>> yes. 
>>>
>>> On Tuesday, March 19, 2019 at 9:25:55 AM UTC, Sebastian Meyer wrote:

 On 19.03.19 09:18, tharan...@gmail.com wrote: 
 >ansible_user= host= 

 Is this the same user you use for normal ssh? When you did the 
 ssh-copy-id you transferred the public key to the remote node only for 
 a 
 single user (I'm guessing root, as you were root on the control node 
 and 
 did not specify a user there). If that user is different from the one 
 you use for ansible, then the key can't be used. 

 - Sebastian 

 -- 
 Sebastian Meyer 
 Linux Consultant & Trainer 
 Mail: me...@b1-systems.de 

 B1 Systems GmbH 
 Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de 
 GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537 

>>>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d04a0aff-1595-4720-b60a-271dfe143ac8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible fail to work with ssh

2019-03-19 Thread tharanga2006
Hi Amit,
Thanks as I mention in my problem
if I gave value for "ansible_ssh_pass= it works , But I don't like to do 
that.


On Tuesday, March 19, 2019 at 9:49:31 AM UTC, Amit Bhardwaj wrote:
>
> Check if this link helps: 
> https://stackoverflow.com/questions/42421774/ansible-permission-problems
>
> Surely some permission issue here. 
>
> On Tuesday, March 19, 2019 at 3:14:38 PM UTC+5:30, tharan...@gmail.com 
> wrote:
>>
>>
>> Is this the same user you use for normal ssh? 
>> yes. 
>>
>> On Tuesday, March 19, 2019 at 9:25:55 AM UTC, Sebastian Meyer wrote:
>>>
>>> On 19.03.19 09:18, tharan...@gmail.com wrote: 
>>> >ansible_user= host= 
>>>
>>> Is this the same user you use for normal ssh? When you did the 
>>> ssh-copy-id you transferred the public key to the remote node only for a 
>>> single user (I'm guessing root, as you were root on the control node and 
>>> did not specify a user there). If that user is different from the one 
>>> you use for ansible, then the key can't be used. 
>>>
>>> - Sebastian 
>>>
>>> -- 
>>> Sebastian Meyer 
>>> Linux Consultant & Trainer 
>>> Mail: me...@b1-systems.de 
>>>
>>> B1 Systems GmbH 
>>> Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de 
>>> GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537 
>>>
>>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/426758a4-f591-41f0-b45c-47707fd584e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible fail to work with ssh

2019-03-19 Thread Amit Bhardwaj
Check if this link helps: 
https://stackoverflow.com/questions/42421774/ansible-permission-problems

Surely some permission issue here. 

On Tuesday, March 19, 2019 at 3:14:38 PM UTC+5:30, tharan...@gmail.com 
wrote:
>
>
> Is this the same user you use for normal ssh? 
> yes. 
>
> On Tuesday, March 19, 2019 at 9:25:55 AM UTC, Sebastian Meyer wrote:
>>
>> On 19.03.19 09:18, tharan...@gmail.com wrote: 
>> >ansible_user= host= 
>>
>> Is this the same user you use for normal ssh? When you did the 
>> ssh-copy-id you transferred the public key to the remote node only for a 
>> single user (I'm guessing root, as you were root on the control node and 
>> did not specify a user there). If that user is different from the one 
>> you use for ansible, then the key can't be used. 
>>
>> - Sebastian 
>>
>> -- 
>> Sebastian Meyer 
>> Linux Consultant & Trainer 
>> Mail: me...@b1-systems.de 
>>
>> B1 Systems GmbH 
>> Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de 
>> GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537 
>>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9916cdbc-c1a4-428b-bf37-185709603c3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible fail to work with ssh

2019-03-19 Thread tharanga2006

Is this the same user you use for normal ssh? 
yes. 

On Tuesday, March 19, 2019 at 9:25:55 AM UTC, Sebastian Meyer wrote:
>
> On 19.03.19 09:18, tharan...@gmail.com  wrote: 
> >ansible_user= host= 
>
> Is this the same user you use for normal ssh? When you did the 
> ssh-copy-id you transferred the public key to the remote node only for a 
> single user (I'm guessing root, as you were root on the control node and 
> did not specify a user there). If that user is different from the one 
> you use for ansible, then the key can't be used. 
>
> - Sebastian 
>
> -- 
> Sebastian Meyer 
> Linux Consultant & Trainer 
> Mail: me...@b1-systems.de  
>
> B1 Systems GmbH 
> Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de 
> GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537 
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/42f5c20d-d117-439d-a012-4cf71170afc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible fail to work with ssh

2019-03-19 Thread tharanga2006
Hi,
step five is to point my inventory ( point my hosts file )

Im using sudo  because  without it Im getting this error
 | FAILED! => {
"msg": "Cannot write to ControlPath /home/blackbeard/.ansible/cp"
}



On Tuesday, March 19, 2019 at 9:11:25 AM UTC, Sudheer Satyanarayana wrote:
>
>
> On 19/03/19 1:48 PM, tharan...@gmail.com  wrote:
>
> OS : Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-104-generic x86_64)
> ansible : ansible 2.7.8
>
> Problem
> I need to configure ansible to run another node without entering the 
> password ( through ssh)
>
> I have followed below method to setup the ssh with no password
>
>1. 
>
>I'm login to the control node with a user having root privileges
>2. 
>
>ssh-keygen
>3. 
>
>ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host
>4. 
>
>ssh remote-host ( works without promoting for password)
>5. 
>
>I copy ansible.cfg to local folder and point my inventory
>-- ansible.cfg-
>[defaults]
>inventory = hosts
>---ansible.cfg-
>
> What's the point of step 5?
>
>
>1. 
>
>my hosts file
>---hosts---
>[rbmqnode1]
>ansible_user= host=
>--hosts
>
>
>1. 
>
>I ran following ansible command
>sudo ansible -m ping all
>its fail with below error
>
> Why are you using sudo? 
>
> | UNREACHABLE! => {
> "changed": false,
> "msg": "Failed to connect to the host via ssh: Permission denied 
> (publickey,password).",
> "unreachable": true
> }
>
> I have went through many solutions but fail to fix this issue. inserting 
> "ansible_ssh_pass" fix me the issue but I dont want to do that. Any help 
> appropriated.
>
>
> -
>
> Sudheer S
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d4a30f53-5298-4fff-9b83-17283d2e93e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible fail to work with ssh

2019-03-19 Thread Sebastian Meyer
On 19.03.19 09:18, tharanga2...@gmail.com wrote:
>ansible_user= host=

Is this the same user you use for normal ssh? When you did the
ssh-copy-id you transferred the public key to the remote node only for a
single user (I'm guessing root, as you were root on the control node and
did not specify a user there). If that user is different from the one
you use for ansible, then the key can't be used.

- Sebastian

-- 
Sebastian Meyer
Linux Consultant & Trainer
Mail: me...@b1-systems.de

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3a20f633-7a9d-b011-db1d-400c7929d6d9%40b1-systems.de.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible fail to work with ssh

2019-03-19 Thread Sudheer Satyanarayana


On 19/03/19 1:48 PM, tharanga2...@gmail.com wrote:


OS : Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-104-generic x86_64)
ansible : ansible 2.7.8

Problem
I need to configure ansible to run another node without entering the 
password ( through ssh)


I have followed below method to setup the ssh with no password

1.

I'm login to the control node with a user having root privileges

2.

ssh-keygen

3.

ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host

4.

ssh remote-host ( works without promoting for password)

5.

I copy ansible.cfg to local folder and point my inventory
-- ansible.cfg-
[defaults]
inventory = hosts
---ansible.cfg-


What's the point of step 5?


1.

my hosts file
---hosts---
[rbmqnode1]
ansible_user= host=
--hosts

1.

I ran following ansible command
sudo ansible -m ping all
its fail with below error


Why are you using sudo?


| UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: Permission denied 
(publickey,password).",

"unreachable": true
}

I have went through many solutions but fail to fix this issue. 
inserting "ansible_ssh_pass" fix me the issue but I dont want to do 
that. Any help appropriated.





-

Sudheer S

--
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ee517c41-9bfb-c7be-e654-8dc5257f4266%40techchorus.net.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ansible fail to work with ssh

2019-03-19 Thread tharanga2006


OS : Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-104-generic x86_64)
ansible : ansible 2.7.8

Problem
I need to configure ansible to run another node without entering the 
password ( through ssh)

I have followed below method to setup the ssh with no password

   1. 
   
   I'm login to the control node with a user having root privileges
   2. 
   
   ssh-keygen
   3. 
   
   ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host
   4. 
   
   ssh remote-host ( works without promoting for password)
   5. 
   
   I copy ansible.cfg to local folder and point my inventory
   -- ansible.cfg-
   [defaults]
   inventory = hosts
   ---ansible.cfg-
   6. 
   
   my hosts file
   ---hosts---
   [rbmqnode1]
   ansible_user= host=
   --hosts
   7. 
   
   I ran following ansible command
   sudo ansible -m ping all
   its fail with below error
   
| UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: Permission denied 
(publickey,password).",
"unreachable": true
}

I have went through many solutions but fail to fix this issue. inserting 
"ansible_ssh_pass" fix me the issue but I dont want to do that. Any help 
appropriated.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8cb6e784-0faf-4311-b711-39514a779ef0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.