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

[FIX] Issue #529: become plugin podman_unshare become_user default #530

Merged
merged 1 commit into from
Nov 30, 2022

Conversation

grzs
Copy link
Contributor

@grzs grzs commented Nov 30, 2022

Signed-off-by: Janos Gerzson [email protected]

@@ -130,8 +129,8 @@ def build_become_command(self, cmd, shell):

becomecmd = 'podman unshare'

user = self.get_option('become_user') or ''
if user:
user = self.get_option('become_user') or 'root'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be the current user by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will run as the current user (ansible_user) if become_user is root, or not set at all (by default).
Actually, if become_user has been set to anything but root it will be executed with sudo, otherwise no sudo applied.
I tested it and was working flawlessly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarification. I think we can add some tests here.
I'll prepare a test skeleton.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use this as a template for tests: #531 Just replace podman_lovely_module by your module/plugin name everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants