Yes, ansible use login root for SSH connection. But why should ansible try
a different user? I run the command against a group of three hosts and only
one fails. The three hosts are from one staging area and configured in the
same way (same user, keys, packages).
Am Dienstag, 19. Juli 2016 14:06:10 UTC+2 schrieb Alexey Vazhnov:
>
> Did ansible use login root for SSH connection? I think Ansible try to
> login with your username, not root. Use «ansible_ssh_user» in inventory
> file, or «--user» in ansible arguments, or «User» in ~/.ssh/config.
>
> On Friday, July 15, 2016 at 12:55:01 PM UTC+5, Jörg Kastning wrote:
>>
>> Hello there,
>>
>> before executing the following commands I started a ssh-agent bash and
>> added my private key.
>>
>> Running the command "ansible all -m ping" checks succeeded but one. For
>> one host I got the following error:
>> host1.example.com | UNREACHABLE! => {
>> "changed": false,
>> "msg": "SSH Error: data could not be sent to the remote host. Make
>> sure this host can be reached over ssh",
>> "unreachable": true
>> }
>>
>> But when I run the following command in the same shell, the connection is
>> successful:
>> ssh [email protected]
>>
>> The section in my inventory file looks like:
>> [host-group]
>> host[1:2].example.com
>> host-test.example.com
>>
>> Only host1 fails, the other two are checkt successfully.
>>
>> I use ansible 2.1.0.0 from EPEL-Repo with RHEL 7.2.
>>
>> Could someone explain to me what's wrong here?
>>
>> Kind regards,
>> Joerg
>>
>
--
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/20623a07-32c0-406a-be1c-8201fdfd49be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.