umgmt ALL = NOPASSWD: /bin/sh -c echo BECOME-SUCCESS-* ; /usr/bin/python
ansible testserver -u umgmt -b -m shell -a idtestserver | CHANGED | rc=0 >>uid=0(root) gid=0(root) groups=0(root)
That is correct, I setup a umgmt account in “Credentials” in AWX. I set “PRIVILEGE ESCALATION METHOD” to sudo, “PRIVILEGE ESCALATION USERNAME” to root, and I left “PRIVILEGE ESCALATION PASSWORD” blank. That results in commands failing with the “Missing sudo password” message when I tick the “ENABLE PRIVILEGE ESCALATION” box in the “EXECUTE COMMAND” page. I changed the method to “runas”, but then there is no escalation at all; it just runs as the umgmt user.
Runas appears to be a Microsoft thing, and I am in a Unix/Linux environment. I have a healthy mix of IBM, RedHat, and Suse, so what ever method I use has to work on all of those.
That is correct, I setup a umgmt account in “Credentials” in AWX. I set “PRIVILEGE ESCALATION METHOD” to sudo, “PRIVILEGE ESCALATION USERNAME” to root, and I left “PRIVILEGE ESCALATION PASSWORD” blank. That results in commands failing with the “Missing sudo password” message when I tick the “ENABLE PRIVILEGE ESCALATION” box in the “EXECUTE COMMAND” page. I changed the method to “runas”, but then there is no escalation at all; it just runs as the umgmt user.
Runas appears to be a Microsoft thing, and I am in a Unix/Linux environment. I have a healthy mix of IBM, RedHat, and Suse, so what ever method I use has to work on all of those.
Actually upon reading this a bit closer. Let me clarify my response. for the user account that is running this, I assume you configured it in awx as a user. under the privilege escalation method, are you using sudo? if so try switching it to run as, or if you do not want to put the escalation method in the user account, you can put it in the script itself using the become command.
how are you trying to elevate your access? try using the becom command in your script:
https://docs.ansible.com/ansible/2.3/become.html
Sorry I haven't had a chance to test this for myself. It should be possible, but I can't confirm without finding some time to test. Day job keeps me from having time to test things outside of that.