puppet-jenkins icon indicating copy to clipboard operation
puppet-jenkins copied to clipboard

$user setting in init.pp#L203 not set/used in /etc/sysconfig/jenkins

Open aamerik opened this issue 8 years ago • 4 comments

Ran into the issue of invalid jenkins user set in /etc/sysconfig/jenkins because https://github.com/jenkinsci/puppet-jenkins/blob/master/manifests/init.pp#L203 $user is not used for /etc/sysconfig/jenkins value of JENKINS_USER, defaults to 'jenkins'.

aamerik avatar Sep 07 '16 07:09 aamerik

The config_hash param and jenkins::sysconfig type are really a misfeature feature as there are multiple sources of truth for some values.

jhoblitt avatar Sep 20 '16 21:09 jhoblitt

so what is the solution to this issue? I have ran into exact same issue where I want to run jenkins as a different user?

techish-io avatar Mar 27 '18 04:03 techish-io

I was able to update jenkins user in sysconfig by passing config_hash like below but jenkins failed to start up and it somehow still creates jenkins user

class { 'jenkins': user => $jenkins_user, group => $jenkins_group, manage_user => $jenkins_manage_user, manage_group => $jenkins_manage_group, config_hash => { 'JENKINS_USER' => { 'value' => $jenkins_user }, }, }

techish-io avatar Mar 27 '18 09:03 techish-io

Ok. Strangely jenkins user still gets created. Does yum install jenkins creates it?

Also, I need to chown /var/log/jenkins and /var/chache/jenkins in order to jenkins work under a different user. Can this be sorted out in jenkins module itself?

techish-io avatar Mar 27 '18 11:03 techish-io