We have a requirement to install Siebel application using Ansible. We are trying to install Oracle Client with Siebel user which we did successfully.

Now next step we want to run one custom shell script which we want to run it using root user.

Here we are stuck as we are not able to update the sudoers file where we can provide all (root) privilege to Siebel user.

So our requirement is to enable Siebel user with root privileges in Ansible playbook where we Passwordless configuration.

Appreciate your help !!

Thanks, Parag

  • 2
    Can you show how you've attempted to do this in your code? – kenlukas Oct 8 '18 at 15:13
  • Are you sure that the user always needs sudo access? Or do you just need to run one script as root? – Michael Hampton Oct 8 '18 at 15:41

To become a user in Ansible requires being able to execute any commands as that user. This is to run various modules.

If you do not want to do this, instead you can configure one rule in sudo to only allow the one script. Then run "sudo -u root /opt/app/shellscript.sh" directly, skipping any Ansible become features. (Substitute your actual script, naturally.)

However, anyone who can write to that shell script can run things as root. This is a security problem. You can install this script with root ownership, but that too will require root access.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.