I'm struggling getting Ansible to run commands under the proper user and I have a feeling it's due to my misunderstanding of how things are working.
For example, I'm provisioning a vagrant box, and in my inventory file I have declared ansible_ssh_user=vagrant as well as ansible_ssh_private_key to use vagrant insecure_private_key. All has been working fine, but for a particular command (synchronize) I want it to run as a different user altogether. I only seem to be able to run commands as the vagrant user or as root. The user I want to run the command as does not have a ssh key nor does it have sudo privileges.
Am I doing things all backwards or missing something simple here?
Thanks so much in advance!
James