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.
ReplyDeleteThanks for sharing this information
Workday Training
Workday Online Training