I'm running Ansible through AWX, (the open source version of Ansible Tower) and I keep running into an error where a user cannot use any of the become
privilege escalation commands. Whenever the commands are run on AWX, it produces an error saying Missing sudo password
. I have confirmed that the user account does have access by running both sudo
and su
under that user account. Both of them work flawlessly when they are run manually.
Simply put, I am looking for a way to run sudo commands from an Ansible playbook, inside AWX. I have verified that the account I am using has the correct permissions.
While it is possible to directly edit the /etc/sudoers
file to allow users to sudo without a password, that is not a solution that will work in this situation.
Ansible does have documentation on privilege escalation, but the correct options do not work through AWX. It replaces several of the command line flags and options with menu-based options, and a google search did not reveal anyone else who had the same error message with AWX.
Note: This is not a duplicate of the following questions, since those questions all concern running Ansible from the command line, not running it from Ansible Tower or AWX. These questions also assume that editing the /etc/sudoers
file will work in all cases.
- Missing sudo password in Ansible
- Specify sudo password for Ansible
- How can a user with SSH keys authentication have sudo powers in Ansible?
I'm posting and immediately answering this question because it took me a little while to figure out the answer. Finding the documentation was far more difficult than it needed to be, and it was missing information, so I'm posting this question with the appropriate answer.