Re: [ansible-project] Re: Permissions issue, cannot become root

2017-08-11 Thread prakash ranjan
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.


Re: [ansible-project] Re: Permissions issue, cannot become root

2017-07-03 Thread Brian Coca
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/CACVha7eS1WsaBX-ibF4M5bccYF%3DuOHCVKjivXNRzLxX6k8VGEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Permissions issue, cannot become root

2017-06-30 Thread Daniel JD
To install packages you need to be root. So set become_user to root. Now 
you need to give ansible your sudo password via "-K". You dont need the 
become_method or become_flags

Am Mittwoch, 28. Juni 2017 10:49:28 UTC+2 schrieb lask001:
>
> Been banging my head against this since yesterday, hoping someone is able 
> to shed some insight on my issues.
>
> I have a simple role that I'm trying to install java with:
>
> ---
> - name: Install JDK
>   yum:
> name: /tmp/jdk.rpm
> state: present
>
>
> This works on my test servers without issue. I am trying to run this on a 
> real server at this point and am running into issues with permissions.
>
> My inventory file is basic:
>
> [severs]
> host1
>
> and my playbook is as follows:
> ---
> - name: Install JDK
>   hosts: servers
>   remote_user: myuser
>   become: true
>   become_user: myuser
>   become_method: sudo
>   become_flags: '-s /bin/sh'
>   roles:
>   - jdk
>
> I've tried quite a few different combinations of setting the become_user 
> to nobody, root, leaving it out, and so on, but have had no success. If I 
> login to the server manually and run a sudo yum install /tmp/jdk as 
> 'myuser' it works fine, and the playbook will actually run after (stating 
> there is nothing to change). Does anyone have any suggestions?
>

-- 
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/cbfb9fdb-5c56-4ebe-a5e4-9cd53a61e2f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.