I think that is normal behaviour with sudo. Unless you specifically configure a to use sudo without password.
Check doc about SUDO Rodolfo El viernes, 25 de noviembre de 2016, 16:25:58 (UTC+1), [email protected] escribió: > > > > Issue - > > [sysadm@ccldevcftsebs1 ~]$ sudo yum repolist -v > [sudo] password for sysadm: > > User part of wheel group and still its asking password ,any idea to fix it > ? > > > [sysadm@ccldevcftsebs1 ~]$ id sysadm > uid=504(sysadm) gid=100(users) groups=10(wheel),100(users) > > play - > > > --- > - hosts: patchdr > become: yes > become_user: sysadm > become_method: sudo > gather_facts: no > tasks: > - name: Cleaning YUM repo > shell: sh -c "sudo yum clean all" > - name: Listing YUM repo > shell: sh -c "sudo yum repolist -v" > > > > > Error - > > [sysadm@pclprdftsnsoft1 ~]$ ansible-playbook patchpre.yml > > PLAY [patchdr] > ***************************************************************** > > TASK [Cleaning YUM repo] > ******************************************************* > fatal: [ccldevcftssoa1]: FAILED! => {"changed": false, "failed": true, > "module_stderr": "", "module_stdout": "[sudo] password for sysadm: > \r\n\r\n{\"changed\": true, \"end\": \"2016-11-25 10:12:32.197150\", > \"stdout\": \"\", \"cmd\": \"sh -c \\\"sudo yum clean all\\\"\", \"rc\": 1, > \"start\": \"2016-11-25 10:07:32.170804\", \"stderr\": \"\", \"delta\": > \"0:05:00.026346\", \"invocation\": {\"module_args\": {\"warn\": true, > \"executable\": null, \"_uses_shell\": true, \"_raw_params\": \"sh -c > \\\"sudo yum clean all\\\"\", \"removes\": null, \"creates\": null, > \"chdir\": null}}, \"warnings\": []}\r\n", "msg": "MODULE FAILURE", > "parsed": false} > fatal: [ccldevcftsebs1]: FAILED! => {"changed": false, "failed": true, > "module_stderr": "", "module_stdout": "[sudo] password for sysadm: > \r\n\r\n{\"changed\": true, \"end\": \"2016-11-25 10:12:32.188713\", > \"stdout\": \"\", \"cmd\": \"sh -c \\\"sudo yum clean all\\\"\", \"rc\": 1, > \"start\": \"2016-11-25 10:07:32.165014\", \"stderr\": \"\", \"delta\": > \"0:05:00.023699\", \"invocation\": {\"module_args\": {\"warn\": true, > \"executable\": null, \"_uses_shell\": true, \"_raw_params\": \"sh -c > \\\"sudo yum clean all\\\"\", \"removes\": null, \"creates\": null, > \"chdir\": null}}, \"warnings\": []}\r\n", "msg": "MODULE FAILURE", > "parsed": false} > > -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/99d6b4f2-df15-44ae-a717-306d14abc5a8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
