I have a playbook where I access as user without privigiles, then i become
root with become: yes and --ask-become-pass.
At some point I have few task that require to be executed as another user
(apache), for example:
- name: Check if maintenance install is present
shell: php occ | grep maintenance
become: yes
become_user: apache
become_method: sudo
args:
chdir: "{{path_installation}}nextcloud/"
register: maintenance_install
I tried to add the regular user to wheel group but it doesn't work, because
I thought that the script would have tried:
- SSH access via regular user (i.e test);
- Detection of the become method and become user indicated in the task
- execution of the task by providing the password used for the regular user
(i.e. test).
But it didn't worked because, I suppose, it uses as become password the one
given with --ask-become-password.
Any suggestion? How could I write the script?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/de142c14-8865-4172-952e-c2868e0c114cn%40googlegroups.com.