[PR #9659/06df717b backport][stable-10] lxd_connection: Allow non-root users to connect to an instance #9751
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a backport of PR #9659 as merged into main (06df717).
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.