Ansible unable to reach multiple hosts

Permission denied (publickey)

when running ssh [email protected] (and other hosts) means sshd at 192.168.1.21 (and other hosts) is not able to get the public key of the user running the ssh command from /home/oytal/.ssh/authorized_keys at 192.168.1.21 (and other hosts), by default.

There may be many reasons for this. Make sure ssh command works

shell> ssh [email protected]

Next, make sure Ansible uses the correct private key (see `ansible-doc -t connection ssh). Try and set it manually. For example

shell> ANSIBLE_PRIVATE_KEY_FILE=$HOME/.ssh/id_rsa ansible 192.168.1.21 -i inventory.yml -u oytal -m ping

Review inventory and Ansible configuration

shell> ansible-config dump

If this doesn't help see other Permission denied (publickey) answers explaining possible reasons for the error.