Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

A way to employ 'sudo' without using 'become' modules is to use the 'shell' module with the 'sudo' command. For example:

- name: Execute command with sudo
  shell: sudo ls /root
  become: false

This will execute the 'ls /root' command with sudo privileges, without using the 'become' module. Be sure to set 'become' to 'false' to avoid any conflicts.