-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
lxd_connection: Allow non-root users to connect to an instance #9659
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
@yeetypete this PR contains the following merge commits: Please rebase your branch to remove these commits. |
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! Please add a changelog fragment. I've also added some first comments below.
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
@felixfontein will do, thanks for the comments! |
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
Co-authored-by: Felix Fontein <[email protected]>
@felixfontein @russoz One issue came up during my testing which I have pushed a fix for: I have preserved the old behavior when root is the lxd user. I guess this issue was not noticable before when the root user was always used. |
The test
The test
The test
The test
|
SUMMARY
Currently the
lxd_connection
only supports connecting to an instance as root. This PR extends the plugin to allow a non-root user, configurable via theansible_user
var to connect to the instance. The optionlxd_become_method
controls the command used to switch users, (su
by default but could also besudo -u
). The defaults ensure the old behavior so this should be a non-breaking change.ISSUE TYPE
COMPONENT NAME
lxd_connection
ADDITIONAL INFORMATION
If it is beneficial I would also be happy to add this functionality to the
incus_connection
andlxc_connection
plugins.