This doesn’t work with the git module. If I use sudo:true and sudo_user: {{item.owner}, then the git module does the correct thing. However, If I do su:true and su_user: {{item.owner}}, then the git module continues to run as root(I am connecting remotely as root for my playbook).
I’m looking at this as well, and believe that I may have identified and fixed the issue. I’m going to talk it over with Paul (angstwad) for validation and testing.
Thanks for this feature, I absolutely need it. I do seem to have an issue using it.
I am using ansible 1.6 (devel eb090ad4a2) on RHEL 6. When I use su with the copy module I get a permission denied error.
I use a remote user to login to the server then su to another acccount. This is required in my environment. The remote user has no home directory so I have remote_tmp set in my ansible.cfg to /tmp/.ansible/tmp. It appears that the su user doesn’t have permission to .ansible/tmp created by the remote user. I saw this issue that is similar, but I could not find anything specifically for su.
Should I file a bug for this?
Since I’m responsible for this feature, its edge cases, and bugs I’ll see what I can do to replicate your issue. I may or may not be able to get to it before the weekend but I’ll follow up.
I thought I tested for this scenario but I may have missed it.
Hi Michael,
I posted about a problem using copy and template module with su on Apr 29th with ansible 1.6.
I probably posted it wrong, I don’t get out much.
Should I have replied to the last message in the thread instead of the first? I also wondered if it was ok to leave all the original quote in or if I should trim it down. My apologies for making you teach me how to use Google Groups.
Hi Paul,
Anything I can do to help with this? I am starting a sprint next week and will be feeling the pain if I can’t use ansible to support our work. I am happy to try and find the issue in source, not so happy to try and edit Python code. I didn’t want to duplicate work if you were already looking at it.
Thanks again for your help!