puppet-jenkins
puppet-jenkins copied to clipboard
$user setting in init.pp#L203 not set/used in /etc/sysconfig/jenkins
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'.
The config_hash
param and jenkins::sysconfig
type are really a misfeature feature as there are multiple sources of truth for some values.
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?
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 }, }, }
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?