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.

On Mon, May 21, 2018 at 12:34 PM, Kannappan M <agileka...@gmail.com> wrote:

> 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)]
>
>
> Regards
> Kannappan M
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/CABxrqnG2e4i%2BwBsf2ObYN69sBBOzbvA0%
> 3DTWWv76h_8CnT-YD%2Bw%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CABxrqnG2e4i%2BwBsf2ObYN69sBBOzbvA0%3DTWWv76h_8CnT-YD%2Bw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v8A_xT-7j%2BgT0RyrtrokEkgvsTw2fd%2B1Q3VvVVFpBXnNw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to