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?

Sett 3 574 ganger
Hopp til første uleste melding

Gary Morse

ulest,
23. feb. 2016, 13:26:2723.02.2016
til Ansible Project
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. 

---
- name: copy source to host directory
  synchronize: >
    src=../../../src/
    dest=/var/www/aaa-newsletter-builder
    times=no
    perms=no
    group=no


{
  "_ansible_no_log": false,
  "module_stderr": "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?\n",
  "changed": false,
  "module_stdout": "",
  "failed": true,
  "parsed": false,
  "msg": "MODULE FAILURE",
  "play": "build email builder",
  "task": "TASKNAME : copy source to host directory",
  "role": "ROLENAME",
  "ignore_errors": null,
  "status": "failed",
  "module_name": "synchronize",
  "module_args": "",
  "created": "2016-02-23T15:09:08.183Z",
  "host_id": 10,
  "host_name": "REDACTED",
  "id": 22370,
  "parent": 22369,
  "event": "Host Failed"
}

Gary Morse

ulest,
23. feb. 2016, 15:58:5423.02.2016
til Ansible Project
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

Brian Coca

ulest,
23. feb. 2016, 16:00:0223.02.2016
til ansible...@googlegroups.com
this should be fixed in 2.0.1 (release imminent, rc2 already available)


----------
Brian Coca
Svar alle
Svar til forfatter
Videresend
0 nye meldinger