-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to run orawls as non-root user #343
Conversation
Add functionality to run orawls with a non-root user. This will work only with Puppet v3.7.0 or higher so as to use the patch for "exec" resource type which does not switch user if running user & target user are same & does not fail for switch user test. Not tested on v4+ Following was done so as to have it running with non-root user: 1. Override default values for wls_domains.yaml & wls_setting.yaml from default /etc to custom location 2. For user parameters in "exec" resource types, puppet has provided a patch from v3.7 onwards to validate & check user if not root & does not fail if user to run as is same as running user. So, for now, non-root user can only be run with puppet v3.7+. 3. For bypassing easy_type running comman with (su -), the code was modified to check it running user is root, else no user is passed to easy_type daemon.rb
Add functionality to run orawls with a non-root user. This will work only with Puppet v3.7.0 or higher so as to use the patch for "exec" resource type which does not switch user if running user & target user are same & does not fail for switch user test. Not tested on v4+ Following was done so as to have it running with non-root user: 1. Override default values for wls_domains.yaml & wls_setting.yaml from default /etc to custom location 2. For user parameters in "exec" resource types, puppet has provided a patch from v3.7 onwards to validate & check user if not root & does not fail if user to run as is same as running user. So, for now, non-root user can only be run with puppet v3.7+. 3. For bypassing easy_type running comman with (su -), the code was modified to check it running user is root, else no user is passed to easy_type daemon.rb
Very nice, I will check it out 👍 |
I had to change the domain.pp to make it work |
Great, thanks a lot. |
very Nice @yadavnikhil .. Thanks a lot Great work |
This will be indeed very usefull |
if debugmode.to_s == 'debug' | ||
puts 'Prepare to run: ' + tmpFile.path + ',' + operatingSystemUser + ',' + domain + ',' + weblogicHomeDir + ',' + weblogicUser + ',' + weblogicPassword + ',' + weblogicConnectUrl | ||
if eval_operatingSystemUser | ||
puts 'Prepare to run: ' + tmpFile.path + ',' + eval_operatingSystemUser + ',' + domain + ',' + weblogicHomeDir + ',' + weblogicUser + ',' + weblogicPassword + ',' + weblogicConnectUrL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weblogicConnectUrL
typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #353
I'm contributing this changes on behalf of Amdocs Development Ltd.
Add functionality to run orawls with a non-root user.
This will work only with Puppet v3.7.0 or higher so as to use the patch for "exec" resource type which does not switch user if running user & target user are same & does not fail for switch user test.
Following was done so as to have it running with non-root user:
This is done by setting facter for overriding these defaults to custom location where the files will persist till the installation lifecycle:
export FACTER_override_wls_domains_file=/wls_domains.yaml
export FACTER_override_wls_setting_file=/wls_setting.yaml
If no facter is specified, it will be created at default location /etc
For user parameter in "exec" resource types, puppet has provided a patch from v3.7 onwards to validate & check user is root or not & does not fail if user to run with is same as running user which invoked puppet.
So to minimize code changes for all exec resources, for now, orawls can be run by non-root user only with puppet v3.7+.