/etc/ansible/hosts has ansible_ssh_user=kbyers defined for this host.
Should this not work?
When the command that fails, the rsync tries to use the local_user i.e. the user that I ran ansible-playbook as (I see in the output an SSH password prompt…local_user@remote_IP )
In the doesn’t work case the user that was used for the rsync SSH connection is not {{ansible_ssh_user}} instead it tried to use the local user that I ran the ansible-playbook as.
When I execute the above playbook, I receive an SSH password prompt asking me to login to the remote machine (for local_user@remote_IP:) where local_user is the user that I ran the playbook as (not user ‘kbyers’). If I change the above to kbyers@{{ansible_ssh_host}}:/REMOTE_PATH, the playbook executes correctly with no password required (i.e. using SSH authorized_keys).