I am also facing the same issue. tried several options but no solution.

Unable to take privilege of "sudo su -". 

This is content of my playbook. Commented ones shows that I have tried 
those options. I have also tried many options with command lines.

---
- hosts: all
#  remote_user: root
#  become: yes
#  become_method: sudo
#  become_exe: "sudo su -"
  become_user: root
  tasks:
     - name: run adhoc command which required root priviledge
#       command: /usr/bin/cat /root/ab
        shell: su monitor -l -c "/usr/bin/cat /root/ab"
#       remote_user: root
#       become: yes #true
#       become_method: sudo
#       become_flags: '-u' # '-s /bin/sh'
#       become_user: root

-Prakash

On Monday, July 3, 2017 at 8:14:44 PM UTC-7, Brian Coca wrote:
>
> you don't even need become_user: root as that is the default. 
>
> ---------- 
> Brian Coca 
>

-- 
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/a11dd1b1-7135-4d51-9ec6-2283d982e181%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to