Ansible server can't ssh to CentOS 8 machine through -m ping

Solution 1:

Troubleshoot the ssh auth problem, same as you would without Ansible.

Connection debugging is printed at verbosity 4, ansible -vvvv. Carefully review the generated ssh command. Capture the rest of the verbose output, in case it shows evidence of some other problem.

Review ssh client configuration: those command line options, ssh_config, any running ssh-agent, authorized keys on the remote. Ansible's ssh connection plugin may use a different key than you are used to interactively. Or, the problem hosts may not have ssh keys deployed correctly.

To get a server perspective, consider temporarily starting a sshd with significantly more verbose logging, say -ddd aka LogLevel DEBUG3.