Cannot change to '/root/..' with sudo_user

35 views
Skip to first unread message

Ryan Stewart

unread,
May 21, 2014, 3:48:44 PM5/21/14
to ansible...@googlegroups.com
I'm running a playbook where remote_user is root, and on some tasks, I use "sudo: yes" with "sudo_user: jenkins" to do some per-user setup. At the moment, I'm trying to clone a git repo. Whether I use the git module or the command module to run "git clone" directly, it keeps failing with:

stderr: fatal: Cannot change to '/root/..': Permission denied

I can work around this by using the command module and adding "chdir=/tmp" to it. I don't know why this works, but it seems there's no other way to do it when using remote_user=root, sudo=yes, and sudo_user=<some other user>. Help?

James Cammarata

unread,
May 21, 2014, 5:47:27 PM5/21/14
to ansible...@googlegroups.com
What version of ansible are you running? Version 1.6 should include a fix for this.


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/06a2e659-6f7e-40a8-9809-e1a91037e0ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages