# procedure to run the previleages command in ansible 2.5

**URL:** <https://forum.ansible.com/t/procedure-to-run-the-previleages-command-in-ansible-2-5/27581>\
**Category:** Ansible Project\
**Created:** [May 21, 2018, 5:34pm UTC](https://forum.ansible.com/t/procedure-to-run-the-previleages-command-in-ansible-2-5/27581 "2018-05-21T17:34:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kanna3k6](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kanna3k6/32/11075_2.png) [@kanna3k6](https://forum.ansible.com/u/kanna3k6)\
**Post date:** [May 21, 2018, 5:34pm UTC](https://forum.ansible.com/t/procedure-to-run-the-previleages-command-in-ansible-2-5/27581/1 "2018-05-21T17:34:26Z")

</div>

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)]

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [May 21, 2018, 5:36pm UTC](https://forum.ansible.com/t/procedure-to-run-the-previleages-command-in-ansible-2-5/27581/2 "2018-05-21T17:36:43Z")

</div>

You have shown /etc/passwd, /etc/group, and /etc/sudoers from the machine you are running ansible from.

However, those configs will also be required on the `iaf` machine as well. That is where `/usr/sbin/shutdown` will be run, and where the sudo configuration matters.
