synchronize sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

after upgrading to ansible 2.0 i am getting an error when trying to synchronize a directory to a remote server. Ansible version: 2.0.0.2

The entire playbook runs with sudo:yes, but the error only happens on the synchronize module. does anyone have have an idea or places to look to resolve my issue?

I switched from synchronize to copy and everything works, but obviously very slow.

for anyone finding this, here’s how i solved it.

The issue is that the synchronize task tries to escalate to root on the tower machine, not on the target host. Since awx user doesnt have sudo permissions, it fails.

to fix this, set sudo to “no” on the task and specify the rsync_path as “sudo rsync”. This will ensure it doesnt sudo on the tower machine.

  • name: copy source to host directory
    synchronize: src=…/…/…/src/ dest=/var/www/aaa-newsletter-builder times=no perms=no group=no rsync_path=“sudo rsync”
    sudo: no

this should be fixed in 2.0.1 (release imminent, rc2 already available)