Merge "Add ability to change the slave gerrit user"

This commit is contained in:
Jenkins 2014-10-16 23:00:55 +00:00 committed by Gerrit Code Review
commit fb9c593f48
4 changed files with 18 additions and 6 deletions

View File

@ -1,3 +0,0 @@
[user]
name = OpenStack Jenkins
email = jenkins@openstack.org

View File

@ -3,6 +3,9 @@
class jenkins::jenkinsuser(
$ssh_key = '',
$ensure = present,
$gitfullname = 'OpenStack Jenkins',
$gitemail = 'jenkins@openstack.org',
$gerrituser = 'jenkins',
) {
group { 'jenkins':
@ -40,7 +43,7 @@ class jenkins::jenkinsuser(
owner => 'jenkins',
group => 'jenkins',
mode => '0640',
source => 'puppet:///modules/jenkins/gitconfig',
content => template('jenkins/gitconfig.erb'),
require => File['/home/jenkins'],
}

View File

@ -4,6 +4,9 @@ class jenkins::slave(
$ssh_key = '',
$user = true,
$python3 = false,
$gitfullname = 'OpenStack Jenkins',
$gitemail = 'jenkins@openstack.org',
$gerrituser = 'jenkins',
) {
include pip
@ -11,8 +14,11 @@ class jenkins::slave(
if ($user == true) {
class { 'jenkins::jenkinsuser':
ensure => present,
ssh_key => $ssh_key,
ensure => present,
ssh_key => $ssh_key,
gitfullname => $gitfullname,
gitemail => $gitemail,
gerrituser => $gerrituser,
}
}

View File

@ -0,0 +1,6 @@
[user]
name = <%= scope.lookupvar('jenkins::jenkinsuser::gitfullname') %>
email = <%= scope.lookupvar('jenkins::jenkinsuser::gitemail') %>
[gitreview]
rebase = false
username = <%= scope.lookupvar('jenkins::jenkinsuser::gerrituser') %>