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?
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.