# Need to drop out of superuser role

**URL:** <https://forum.ansible.com/t/need-to-drop-out-of-superuser-role/20179>\
**Category:** Ansible Project\
**Created:** [January 12, 2016, 4:05pm UTC](https://forum.ansible.com/t/need-to-drop-out-of-superuser-role/20179 "2016-01-12T16:05:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Constant](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@Mark\_Constant](https://forum.ansible.com/u/Mark_Constant)\
**Post date:** [January 12, 2016, 4:05pm UTC](https://forum.ansible.com/t/need-to-drop-out-of-superuser-role/20179/1 "2016-01-12T16:05:31Z")

</div>

I have a playbook where I have to run a bunch of commands as sudo. So at the beginning of the playbook I put become: yes.  
The issue is there is one command running a shell script where the shell script can’t be run as super user. Almost like I have to deescalate privileges.  
If I just run the playbook I get the error from the .sh installer that you can’t run as root.  
Under the name: Install Product I have tried everything to switch users to a non root user but the playbook basically hangs. I can’t tell where the issue is. Nothing happens.

I have tried  
Name: Install Software  
become: no

Also have tried  
Name: Install Software  
become: yes  
become\_user: rhapuser  
become\_method: su

But no matter what I do it just stalls at TASK: Install Software

Is there a way to basically remove root privileges for just one command or figure out why it is not running?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 12, 2016, 4:16pm UTC](https://forum.ansible.com/t/need-to-drop-out-of-superuser-role/20179/2 "2016-01-12T16:16:01Z")

</div>

it should be as simple as using `become: no`

here i demonstrate with a simple test:

- hosts: nyx  
become: yes  
tasks:  
&nbsp;&nbsp;&nbsp;- shell: whoami  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;register: me

&nbsp;&nbsp;&nbsp;- debug: msg="{{me.stdout}}"

&nbsp;&nbsp;&nbsp;- shell: whoami  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;become: no  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;register: me

&nbsp;&nbsp;&nbsp;- debug: msg="{{me.stdout}}"

ANSIBLE\_NOCOWS=1 ansible-playbook play.yml -K  
SUDO password:

PLAY \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [nyx]

TASK [command] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [nyx]

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [nyx] =\> {  
&nbsp;&nbsp;&nbsp;"msg": "root"  
}

TASK [command] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [nyx]

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [nyx] =\> {  
&nbsp;&nbsp;&nbsp;"msg": "bcoca"  
}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
nyx : ok=5 changed=2 unreachable=0 failed=0

---

<div class="post-metadata">

**Author:** ![Mark\_Constant](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@Mark\_Constant](https://forum.ansible.com/u/Mark_Constant)\
**Post date:** [January 12, 2016, 9:07pm UTC](https://forum.ansible.com/t/need-to-drop-out-of-superuser-role/20179/3 "2016-01-12T21:07:29Z")

</div>

I think I found the issue. The issue is that when I run the installer even though I provide an answer file like the directions say the installer still prompts when I run it locally. I thought it used the answer file to just run the installer without prompts. I guess not.
