-
Notifications
You must be signed in to change notification settings - Fork 199
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
os.chdir fails if the sudo/become user lacks adequate permissions to chdir prior to task #636
Comments
Seeing this same issue using ansible 2.8 and mitogen 0.2.8; in our case though we're running ansible/mitogen during an AWS user-data script, so it runs as root. The file task fails when we used become_user to switch to a local service account. In our case we can work around it since the become_user wasn't a necessary step for the execution, so we just removed it. @dw this is actually becoming a pretty major error, it impacts multiple tasks in our playbooks, and we cannot roll back to 0.2.7 because it isn't compatible with ansible 2.8 Looks to be related to the fix from #591 |
…h the cwd disables descent. Fall back to Mitogen's temporary directory. In relation to mitogen-hq#636.
…h the cwd disables descent. Fall back to Mitogen's temporary directory. In relation to mitogen-hq#636.
…h the cwd disables descent. Fall back to Mitogen's temporary directory. In relation to mitogen-hq#636.
…h the cwd disables descent. Fall back to Mitogen's temporary directory. In relation to mitogen-hq#636.
…h the cwd disables descent. Fall back to Mitogen's temporary directory. In relation to mitogen-hq#636.
I think I've just hit this as well ... is there a workaround? My use case is this.. and I think I found a workaround for me:
This runs local to where I issued the ansible command per delegate_to, so I just become the user who issues the ansible command as a workaround. |
in which the cwd disables descent. Fall back to Mitogen's temporary directory. Fixes mitogen-hq#636.
2.8.2
No
module_utils
loaded?No
Yes
os.chdir in runner.py does not check for permissions before attempting chdir. If permissions for the sudo user prohibit access to the cwd, then the task fails.
CentOS 7.6.1810
CentOS stock, 2.7.5
version along with output of "ansible-config dump --only-changed".
Sample play to reproduce the behavior:
Verification of the permissions:
Then if we change permissions to allow access by user "postgres":
Likewise the play completes as expected:
The text was updated successfully, but these errors were encountered: