become_user
requires become
to work as expected ANS-E5001become_user
without become: yes
will not actually change user.
When become
is set to yes
but become_user
is not set, user root
is set.
- name: Run a command as the apache user
command: somecommand
become_user: apache
- name: Run a command as the apache user
command: somecommand
become: yes
become_user: apache