Despite become_method being mentioned in the documentation and evaluated when set, containers.podman.podman_unshare is unable to function with any value for become_method other than sudo, due to forcibly injecting sudo-specific CLI parameters without respect for the become method select (so even if you use su, you will still get sudo parameters appended to the attempted call leading to an error.
The current code makes it completely impossible to use containers.podman.podman_unshare with a loginless account, the forced injection of -i even prevents you from manually appending -s because -i and -s are mutually exclusive.
Despite
become_method
being mentioned in the documentation and evaluated when set,containers.podman.podman_unshare
is unable to function with any value forbecome_method
other thansudo
, due to forcibly injectingsudo
-specific CLI parameters without respect for the become method select (so even if you usesu
, you will still getsudo
parameters appended to the attempted call leading to an error.The culprit is in https://github.com/containers/ansible-podman-collections/blob/181de1463355118385ebc3fcb8f305ca404bc94d/plugins/become/podman_unshare.py#L135-L137 where the CLI parameters are added despite checking the become method a line earlier; I would think they should be added conditionally (and ideally,
become_flags
should be respected at that point as well). I'm not sure whybecome_exe
is documented and used at all, it seemssudo
is the only possible value that can run without error.The current code makes it completely impossible to use
containers.podman.podman_unshare
with a loginless account, the forced injection of-i
even prevents you from manually appending-s
because-i
and-s
are mutually exclusive.