Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy fails when used with sudo_user #3705

Closed
lorin opened this issue Jul 30, 2013 · 1 comment · Fixed by #3706
Closed

copy fails when used with sudo_user #3705

lorin opened this issue Jul 30, 2013 · 1 comment · Fixed by #3706
Labels
bug This issue/PR relates to a bug.

Comments

@lorin
Copy link
Contributor

lorin commented Jul 30, 2013

I'm getting an error when using the copy action when specifying a sudo_user. Here's an example playbook:

- hosts: myserver
  sudo: True
  sudo_user: lorin
  tasks:
    - name: ensure .gitconfig file is present
      copy: src=files/.gitconfig dest=/home/lorin/.gitconfig

Running this returns the following error:

TASK: [ensure .gitconfig file is present] *************************************
failed: [myserver] => {"failed": true}
msg: Could not replace file: /tmp/ansible-1375213714.07-124608323343148/source to /home/lorin/.gitconfig: [Errno 13] Permission denied

Error reproduces when sudo_user is attached to either the play or the task.

I did a git-bisect, and the commit that introduced the commit appears to be dafbcf8

@mpdehaan
Copy link
Contributor

Let's not categorize regression or not regression, you have a bug report :)

mpdehaan pushed a commit that referenced this issue Aug 2, 2013
Treat errno 13 (permission denied) as one of the special cases in
atomic_move.

This type of error can occur because of sudo'ing to non-root user.

Fixes #3705
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 6, 2018
@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants