On 12/11/19 10:21 AM, Ganeshwari Sk wrote:
> in Ansible playbook, I want to do two task, one to check passwdless ssh login is enabled or not, and in another task if
> passwdless login not abled for the remote host, then execute the ssh-copy-id command.
> I have written the following playbook, but it is not working as desired, please help me to resolve the issue.
>
Gathering facts already requires a working SSH connection, so it stops before executing your tasks.
It doesn't really makes sense to me what you are doing.
Regards
Racke
> *I am getting this output:*
> LAY [Check passwdless login]
> ******************************************************************************************************************************************************************************
>
> TASK [Gathering Facts]
> *************************************************************************************************************************************************************************************
> fatal: [x.x.x.x]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Address x.x.x.x maps
> to
test.testlab.com, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!\r\nPermission denied
> (publickey,gssapi-keyex,gssapi-with-mic,password).\r\n", "unreachable": true}
> to retry, use: --limit @/etc/ansible/passwordless.retry
>
> PLAY RECAP
> *************************************************************************************************************************************************************************************************
> x.x.x.x : ok=0 changed=0 unreachable=1 failed=0
>
> --
> 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-proje...@googlegroups.com <mailto:
ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ansible-project/ca240694-d328-4d69-8764-ecc1596c3b85%40googlegroups.com
> <
https://groups.google.com/d/msgid/ansible-project/ca240694-d328-4d69-8764-ecc1596c3b85%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.