Here is the case, I want run this command on all servers, out of it one server does not have current user{smodak} in sudoers file. Due to switch it asks both the passwords
one for ssh and another for sudo. For all remaining server s where sudo is required and rightly provided it works fine but for 1st server where user is not in sudoers file
it gives module error. Why cant ansible run this command which does not require sudo user on 1st server where it is actually not present. We can understand if command requries any high privilege then module failure is accepted but for low privilege it should work as we already providing ssh password.
[smodak@hel-shell-2 ~]$ ansible all -b -K -m shell -a “/bin/date”
SSH password:
SUDO password[defaults to SSH password]:
NESBWDA01 | FAILED | rc=0 >>
MODULE FAILURE
NESECDA01 | SUCCESS | rc=0 >>
Sat Jul 29 21:57:51 EEST 2017
NESGRDDB01 | SUCCESS | rc=0 >>
Sat Jul 29 21:57:51 EEST 2017