{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1162","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1162/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1162/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1162/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/1162","id":69342751,"number":1162,"title":"synchronize applies sudo incorrectly","user":{"login":"feuerbach","id":24844,"avatar_url":"https://avatars.githubusercontent.com/u/24844?v=3","gravatar_id":"","url":"https://api.github.com/users/feuerbach","html_url":"https://github.com/feuerbach","followers_url":"https://api.github.com/users/feuerbach/followers","following_url":"https://api.github.com/users/feuerbach/following{/other_user}","gists_url":"https://api.github.com/users/feuerbach/gists{/gist_id}","starred_url":"https://api.github.com/users/feuerbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feuerbach/subscriptions","organizations_url":"https://api.github.com/users/feuerbach/orgs","repos_url":"https://api.github.com/users/feuerbach/repos","events_url":"https://api.github.com/users/feuerbach/events{/privacy}","received_events_url":"https://api.github.com/users/feuerbach/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/bug_report","name":"bug_report","color":"fbca04"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/P3","name":"P3","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-18T20:02:35Z","updated_at":"2015-08-07T19:46:04Z","closed_at":null,"body":"##### Issue Type:\r\n\r\nBug Report\r\n\r\n##### Ansible Version:\r\n\r\n```\r\nansible 1.8.2\r\n  configured module search path = None\r\n```\r\n\r\n##### Environment:\r\n\r\nControl: Fedora 21, Target: Debian 7\r\n\r\n##### Summary:\r\n\r\nWhen invoking rsync, it looks like sudo is applied to the invokation on the control machine, not on the target one.\r\n\r\n##### Steps To Reproduce:\r\n\r\nHave the control machine prompt password upon sudo, and the target one not to.\r\n\r\nInventory file:\r\n\r\n```\r\nvagrant ansible_sudo=true ansible_ssh_user=vagrant\r\n```\r\n\r\nExecute\r\n\r\n```\r\nansible vagrant -vvvvv -m synchronize -a 'set_remote_user=no src=x dest=/etc/z'\r\n```\r\n\r\n##### Expected Results:\r\n\r\nI'd expect the command to succeed. E.g. if I replace synchronize with copy in the above example (and remove `set_remote_user=no`), it succeeds.\r\n\r\n##### Actual Results:\r\n\r\n```\r\n<127.0.0.1> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1429387186.36-81932903674806 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1429387186.36-81932903674806 && echo $HOME/.ansible/tmp/ansible-tmp-1429387186.36-81932903674806']\r\n<127.0.0.1> PUT /tmp/tmpJQlYGS TO /home/feuerbach/.ansible/tmp/ansible-tmp-1429387186.36-81932903674806/synchronize\r\n<127.0.0.1> EXEC /bin/sh -c 'sudo -k && sudo -H -S -p \"[sudo via ansible, key=ylobszwtfqjppaosnitxtqifoyqeimcy] password: \" -u root /bin/sh -c '\"'\"'echo SUDO-SUCCESS-ylobszwtfqjppaosnitxtqifoyqeimcy; LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /home/feuerbach/.ansible/tmp/ansible-tmp-1429387186.36-81932903674806/synchronize; rm -rf /home/feuerbach/.ansible/tmp/ansible-tmp-1429387186.36-81932903674806/ >/dev/null 2>&1'\"'\"''\r\nvagrant | FAILED >> {\r\n    \"failed\": true, \r\n    \"msg\": \"[sudo via ansible, key=ylobszwtfqjppaosnitxtqifoyqeimcy] password: \\n\", \r\n    \"parsed\": false\r\n}\r\n```\r\n\r\nI.e. it tries to run sudo on the control machine and fails."},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/128808656","html_url":"https://github.com/ansible/ansible-modules-core/issues/1162#issuecomment-128808656","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1162","id":128808656,"user":{"login":"timrchavez","id":395269,"avatar_url":"https://avatars.githubusercontent.com/u/395269?v=3","gravatar_id":"","url":"https://api.github.com/users/timrchavez","html_url":"https://github.com/timrchavez","followers_url":"https://api.github.com/users/timrchavez/followers","following_url":"https://api.github.com/users/timrchavez/following{/other_user}","gists_url":"https://api.github.com/users/timrchavez/gists{/gist_id}","starred_url":"https://api.github.com/users/timrchavez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timrchavez/subscriptions","organizations_url":"https://api.github.com/users/timrchavez/orgs","repos_url":"https://api.github.com/users/timrchavez/repos","events_url":"https://api.github.com/users/timrchavez/events{/privacy}","received_events_url":"https://api.github.com/users/timrchavez/received_events","type":"User","site_admin":false},"created_at":"2015-08-07T19:46:04Z","updated_at":"2015-08-07T19:46:04Z","body":"FWIW I'm experiencing this issue on 2.0.0"}}