Thanks for your Views ... I tried that but it seem same error ... 

below is my playbook 

.
---
- hosts: unix
  become: yes
  become_method: su
  tasks:
  - name: reboot servers
    command: /sbin/reboot


error --

TASK [reboot servers] 
***************************************************************************************************************************************
fatal: [192.168.1.10]: FAILED! => {"changed": true, "cmd": 
["/sbin/reboot"], "delta": "0:00:00.014962", "end": "2018-02-28 
18:11:20.468716", "failed": true, "rc": 1, "start": "2018-02-28 
18:11:20.453754", "stderr": "reboot: Need to be root", "stderr_lines": 
["reboot: Need to be root"], "stdout": "", "stdout_lines": []}


regards...Hemant 



On Wednesday, February 28, 2018 at 10:40:08 AM UTC+5:30, Hemant Kulkarni 
wrote:
>
> Hello Team,
>
> I need to  reboot my servers using ansible ,my Problem is  i dont have 
> sudo user , i have normal user and root password ..
>
> admin = normal user 
>
> here is my simple playbook ...
>
> - hosts: unix
>   tasks:
>   - name: reboot servers
>     command: /sbin/reboot
>
> as of now I tried below Option 
>
> ansible-playbook packge_install.yum  -i hosts  --su-user=root  
> --ask-su-pass
> ansible-playbook packge_install.yum  -i hosts --user=admin --ask-pass --su 
> --ask-su-pass
>
> but its not working ... any idea How to achieve this ?
>
> regards...Hemant 
>
>
>
>

-- 
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/523f60ed-1291-498a-b6a7-33904931b425%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to