Dear
Good afternoon, sorry for the inconvenience, I’m just getting started with what Ansible is, specifically learning how to optimize daily tasks in laboratories. I set up a virtualized network with a central ansible server, from where I apply ad-hoc commands and automated playbooks.yml files that point to remote hosts, I managed to configure three machines with different Debian distributions, I can connect via ssh without any problem, each machine has the corresponding public key, which I copied from the central server, that is, every time I connect via ssh it does not ask me for a password, this is a fundamental requirement when applying ad-hoc or playbook commands, with these machines I have no problems of ssh connectivity. I wanted to expand the network by adding a group called ClientWindows to the inventory file, which will host computers with Microsoft Windows 10 Pro, via ssh I can connect directly to this type of machine without any problem, I also configure them so that they do not ask me for the password when applying ad-hoc or playbook.yml commands, but here comes a problem, every time I apply an ad-hoc or playbook.yml command it gives me connectivity problems via ssh (Permission denied), when I see the connectivity error I deduce that by default ssh points to the root user, but it turns out that I am trying to connect to a machine with Windows 10 Pro that has the administrator username, the strange thing about all this is that when I connect via ssh directly (ssh administrator@x.x.x.x ) I have no problem, in fact I have configured the ssh connection so that it does not ask me for a password, I am attaching a file with the details of what I mentioned earlier, I would appreciate your guidance, regards.
You are running the script from root user. So it is trying to connect root@ip not administrator@ip
Need to specify your target ssh user.
in ansible.cfg configuration file you can specify
Remote_user = administrator