With this PR, ansible-yay can be run using Ansible from the root user when become: true and become_user: <user> are specified.
Background
I am developing a playbook for myself that sets up an entire system from a very minimal arch install. I want this to be run from the root user as part of the script is setting up user(s) etc. In the current state, ansible-yay will run installation as sudo -u root yay ... which obviously won't work. I thus want to be able to run ansible-yay using the newly created user, example:
Hi!
I'm not sure if you want any PRs but here goes...
What
With this PR,
ansible-yay
can be run using Ansible from the root user whenbecome: true
andbecome_user: <user>
are specified.Background
I am developing a playbook for myself that sets up an entire system from a very minimal arch install. I want this to be run from the root user as part of the script is setting up user(s) etc. In the current state,
ansible-yay
will run installation assudo -u root yay ...
which obviously won't work. I thus want to be able to runansible-yay
using the newly created user, example:This PR implements the change I made to solve this issue.