Allow remote execution become any user.
This PR fix the sudoers.d/user_name configuration to allow the user to run playbooks with others users than root, for example:
- name: Simple playbook demonstrating become and become_user
hosts: all
tasks:
- name: Create a file as the root user (works well)
ansible.builtin.file:
path: /tmp/root_file.txt
state: touch
become: true
become_user: root
- name: Create a file as a different user (dont works, because the users is other than root)
ansible.builtin.file:
path: /tmp/www_data_file.txt
state: touch
become: true
become_user: www-data
I'm not sure that's a big deal. If you can become root, you can then run things as any user anyway. Security wise I don't think there's a difference.
Thank you for your contribution! This PR has been inactive for 3 months, closing for now. Feel free to reopen when you return to it. This is an automated process.
Hi @adamruzicka and @ekohl can you reopen this ? I dont have the privileges to do it !! :-(
Yes, sorry about this, this somehow fell through the cracks.
Could you please reword the commit message to 'Fixes #38030 - Allow remote execution become any user' to link it to the redmine issue https://projects.theforeman.org/issues/38030 and make the redmine issues check pass ?
Sadly, you'll need to reword the commit itself, changing just the title of the pull request isn't enough to make the check happy.
I hope that is enough now !! :-)
@vhsantos Thank you and congratulations on your first contribution to foreman 🎉