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.
Asked: 2023-07-15 01:20:40 +0000
Seen: 14 times
Last updated: Jul 15 '23