Ansible --become not working when “sudo with NOPASSWD” is not activated on remote machine - MODULE FAILURE

Hi,

In remote server, normal user is having sudo access but NOPASSWD not activated. sudo su - command ask for user password. I am trying to run a command using Ansible as providing sudo password but its not working getting “MODULE FAILURE\nSee stdout/stderr for the exact error” error. Please check below logs.

Inventory file

Hi,

Sounds strange indeed.

Please try to connect to remote server with ssh with remote_user, and do a “sudo ls /” for example to see if the problem occurs

You did authorize all commands for sudo and not only “sudo su -”? (something like this below)

%sudo ALL=(ALL:ALL) ALL

Regards,

JYL