Hi Team,
Am facing problem in running elevated commands these are my tries kindly suggest a best solution to fix this problem. I dont have problem in running the normal ping command when i ran the elevated command am facing problem.
[tester@ansi ~]$ ansible iaf -m command -a “/usr/sbin/shutdown -h now” --become -K
SUDO password:
iaf | FAILED! => {
“changed”: false,
“module_stderr”: “Shared connection to iaf closed.\r\n”,
“module_stdout”: “\r\ntester is not in the sudoers file. This incident will be reported.\r\n”,
“msg”: “MODULE FAILURE”,
“rc”: 1
}
[tester@ansi ~]$ sudo cat /etc/passwd |grep tester
tester:x:1001:1001::/home/tester:/bin/bash
[tester@ansi ~]$ sudo cat /etc/group |grep tester
wheel:x:10:tester
tester:x:1001:
[tester@ansi ~]$ ansible iaf -m ping
iaf | SUCCESS => {
“changed”: false,
“ping”: “pong”
}
[tester@ansi ~]$ sudo grep -v ‘#’ /etc/sudoers |grep tester
tester ALL=NOPASSWD: ALL
[tester@ansi ~]$ ansible --version
ansible 2.5.2
config file = /etc/ansible/ansible.cfg
configured module search path = [u’/home/tester/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Apr 11 2018, 07:36:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]