I have a group of old HP-UX servers that I need to manage with Ansible. I started by installing python-2.7.13 on one server, then testing with a simple Ansible ping:
sinuid06-> ansible sinuid02 -m ping
sinuid02 | SUCCESS => {
“changed”: false,
“ping”: “pong”
}
That went well. Then I tried to do the same test but with sudo:
sinuid06-> ansible sinuid02 -bK -m ping
SUDO password:
sinuid02 | FAILED! => {
“failed”: true,
“msg”: “Incorrect sudo password”
}
But sudo works when I log into the server and type the command:
sinuid02-> sudo -i
Password:
Value of TERM has been set to “putty”.
WARNING: YOU ARE SUPERUSER !!
And Ansible works when I use the raw module with sudo:
sinuid06-> ansible sinuid02 -sK -m raw -a id
SUDO password:
sinuid02 | SUCCESS | rc=0 >>
uid=0(root) gid=3(sys) groups=0(root),1(other),2(bin),4(adm),5(daemon),6(mail),7(lp),20(users),103(hpvmsys)
But it fails with the shell or command modules:
sinuid06-> ansible sinuid02 -sK -m command -a id
SUDO password:
sinuid02 | FAILED | rc=0 >>
Incorrect sudo password
I tried updating sudo on the target server, but that did not help:
sinuid02-> sudo --version
Sudo version 1.8.20p2
Sudoers policy plugin version 1.8.20p2
Sudoers file grammar version 46
Sudoers I/O plugin version 1.8.20p2
So what is different about how the modules execute sudo on HP-UX and what can I do to correct it?
-Mark