Ansible

Ansible

Made by DeepSource

become_user requires become to work as expected ANS-E5001

Bug risk
Major

become_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.

Bad practice

- name: Run a command as the apache user
  command: somecommand
  become_user: apache

Recommended

- name: Run a command as the apache user
  command: somecommand
  become: yes
  become_user: apache