system-config/modules/jenkins/manifests/jenkinsuser.pp
Clark Boylan f40847dd78 Kill trailing whitespace.
Killed trailing whitespace in the puppet repo files using
`sed -r 's/\s+$//'`. Skip binary files and html templates for lodgeit
and mailman.

Change-Id: Ib43493161d8f0e8fae1426b22fb1737832ca14cd
Reviewed-on: https://review.openstack.org/12969
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2012-10-05 23:27:31 +00:00

161 lines
3.5 KiB
Puppet

class jenkins::jenkinsuser($ensure = present, $sudo = false, $ssh_key) {
group { 'jenkins':
ensure => 'present'
}
if ($sudo == true) {
$groups = ['sudo', 'admin']
} else {
$groups = []
}
user { 'jenkins':
ensure => 'present',
comment => 'Jenkins User',
home => '/home/jenkins',
gid => 'jenkins',
shell => '/bin/bash',
membership => 'minimum',
groups => $groups,
require => Group['jenkins']
}
file { 'jenkinshome':
name => '/home/jenkins',
owner => 'jenkins',
group => 'jenkins',
mode => 644,
ensure => 'directory',
require => User['jenkins']
}
file { 'jenkinspipdir':
name => '/home/jenkins/.pip',
owner => 'jenkins',
group => 'jenkins',
ensure => 'directory',
require => File['jenkinshome'],
}
file { 'jenkinspipconf':
name => '/home/jenkins/.pip/pip.conf',
owner => 'jenkins',
group => 'jenkins',
mode => 640,
ensure => 'present',
source => "puppet:///modules/jenkins/pip.conf",
require => File['jenkinspipdir'],
}
file { 'jenkinspydistutilscfg':
name => '/home/jenkins/.pydistutils.cfg',
ensure => 'absent',
require => File['jenkinshome'],
}
file { 'jenkinsgitconfig':
name => '/home/jenkins/.gitconfig',
owner => 'jenkins',
group => 'jenkins',
mode => 640,
ensure => 'present',
source => "puppet:///modules/jenkins/gitconfig",
require => File['jenkinshome'],
}
file { 'jenkinssshdir':
name => '/home/jenkins/.ssh',
owner => 'jenkins',
group => 'jenkins',
mode => 600,
ensure => 'directory',
require => File['jenkinshome'],
}
file { 'jenkinskeys':
name => '/home/jenkins/.ssh/authorized_keys',
owner => 'jenkins',
group => 'jenkins',
mode => 640,
content => "${ssh_key}",
ensure => 'present',
require => File['jenkinssshdir'],
}
file { 'jenkinsbashrc':
name => '/home/jenkins/.bashrc',
owner => 'jenkins',
group => 'jenkins',
mode => 640,
source => "/etc/skel/.bashrc",
replace => 'false',
ensure => 'present',
}
file { 'jenkinsbash_logout':
name => '/home/jenkins/.bash_logout',
source => "/etc/skel/.bash_logout",
owner => 'jenkins',
group => 'jenkins',
mode => 640,
replace => 'false',
ensure => 'present',
}
file { 'jenkinsprofile':
name => '/home/jenkins/.profile',
source => "/etc/skel/.profile",
owner => 'jenkins',
group => 'jenkins',
mode => 640,
replace => 'false',
ensure => 'present',
}
file { 'jenkinssshconfig':
name => '/home/jenkins/.ssh/config',
owner => 'jenkins',
group => 'jenkins',
mode => 640,
ensure => 'present',
require => File['jenkinssshdir'],
source => [
"puppet:///modules/jenkins/ssh_config",
],
}
file { 'jenkinsgpgdir':
name => '/home/jenkins/.gnupg',
owner => 'jenkins',
group => 'jenkins',
mode => 700,
ensure => 'directory',
require => File['jenkinshome'],
}
file { 'jenkinspubring':
name => '/home/jenkins/.gnupg/pubring.gpg',
owner => 'jenkins',
group => 'jenkins',
mode => 600,
ensure => 'present',
require => File['jenkinsgpgdir'],
source => [
"puppet:///modules/jenkins/pubring.gpg",
],
}
file { 'jenkinsconfigdir':
name => '/home/jenkins/.config',
owner => 'jenkins',
group => 'jenkins',
mode => 755,
ensure => 'directory',
require => File['jenkinshome'],
}
}