Skip to main content

Posts

Showing posts with the label become_user

Ansible sudo: a password is required

Getting "sudo: a password is required\r\n", "msg": "MODULE FAILURE", "rc": 1} While running following command to run Ansible playbook getting error message "sudo: a password is required\r\n", "msg": "MODULE FAILURE", "rc": 1} $ ansible-playbook <PlayBookFileName> .yml -i <PathToHostFileName>/ hosts Means in a playbook you define to login as one user, and becoming another user while executing command on remote host, which require password as follows. Most of the organization has adopted a policy to use Active Directory to login into Linux server, during these days. remote_user: <ActiveDirectory ID> become_user: root You can use either -K , OR --ask-become-pass and ask for privilege escalation password. And your playbook will be executed successfully. Add option -K as follows $ ansible-playbook <PlayBookFileName>.yml -i <PathToHostFileName>/hosts -K