WebHosting

Sunday, August 30, 2020

module_stderr": "sudo: a password is required

 This error appears when we try to run an ansible script with a user that is not enabled for passwordless sudo. 

On this error we have two options with us:

1. Make the user run sudo without a password, for which open /etc/sudoers and put the following line for the user for which passwordless ssh is needed"

Then 

shashwat          ALL=(ALL:ALL) NOPASSWD: ALL

#Note: Add this line to the end of the file


Save and Exit and run the ansible script again.

2. option is to enable ansible to ask sudo password on command line. For which you need to pass parameter

--ask-become-pass or -K 

And this will ask for password on command line and ansible will run sucessfully.

Featured Posts

Error Message in DBeaver connecting using jdbc: Public Key Retrieval is not allowed

Fixing “Public Key Retrieval is not allowed” Error in MySQL with DBeaver   If you are trying to connect MySQL 8+ with DBeaver and suddenly...