-
Notifications
You must be signed in to change notification settings - Fork 154
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
synchronize: fix to honor become_user when become_method sudo #187
synchronize: fix to honor become_user when become_method sudo #187
Conversation
The changelog fragment apparently has to be in the last commit? That doesn't seem right. It means one can't add commits to the branch tip without an interactive rebase every time to reorder them. The command it's using to determine is:
but shouldn't it use instead:
I don't know the right name for the templated branch variable ie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
You're right about changelog fragment check bug, I can't find the repository to open an issue/PR to fix this bug right now.
my patch was working fine, then after only a trivial change to changelog fragment was made, now this:
not clear what that has to do with my patch? |
I would just ignore the CI :) |
the repository for CI bugs might be https://github.com/ansible/ansibullbot |
recheck |
FYI, don't see the changelog fragment detection code in ansibullbot repo anywhere, so it must be somewhere else |
@quidame @aminvakil Could you please review this and let me know? Thanks in advance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
recheck |
SUMMARY
When
become_method
is sudo, thesynchronize
module ignoresbecome_user
, always running as root. This means one cannot create files as a target user, when they need to get in via a third user and can onlysudo
via that one. In my case, I'm connecting via a special provisioning user that has sudo privs, but I need to create the files as thebecome_user
. I'm using it to deposit skeleton files, and there should be no reason to run another task withchown
; after all, the documentation already describes the desired behavior:This patch takes the running
become_user
(if it's notNone
) and adds it to thesudo
command with the-u
command line option, so the file gets created correctly. I have tested this and it works.Other
become_method
s are ignored, but they already were anyways (the code already has a TODO to add other methods, which we don't attempt in this patch)Fixes #186
ISSUE TYPE
COMPONENT NAME
synchronize
ADDITIONAL INFORMATION
See reproduction in #186.
This appears to have been in place since ansible/ansible@811a906