Cleanup jenkins manifest lint errors. Take 2.
Change-Id: Id45aa43e20d281babd89f06f552bb244f2da353a Reviewed-on: https://review.openstack.org/14896 Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com> Approved: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
This commit is contained in:
parent
02d0aa1ecb
commit
2332c2ecfc
@ -1,37 +1,40 @@
|
||||
# == Class: jenkins::cgroups
|
||||
#
|
||||
class jenkins::cgroups {
|
||||
|
||||
package { 'cgroup-bin':
|
||||
ensure => present
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
file { '/etc/cgconfig.conf':
|
||||
ensure => present,
|
||||
replace => true,
|
||||
owner => root,
|
||||
mode => 0644,
|
||||
content => template('jenkins/cgconfig.erb')
|
||||
owner => 'root',
|
||||
group => 'jenkins',
|
||||
mode => '0644',
|
||||
content => template('jenkins/cgconfig.erb'),
|
||||
}
|
||||
|
||||
file { '/etc/cgrules.conf':
|
||||
ensure => present,
|
||||
replace => true,
|
||||
owner => root,
|
||||
mode => 0644,
|
||||
source => 'puppet:///modules/jenkins/cgroups/cgrules.conf'
|
||||
owner => 'root',
|
||||
group => 'jenkins',
|
||||
mode => '0644',
|
||||
source => 'puppet:///modules/jenkins/cgroups/cgrules.conf',
|
||||
}
|
||||
|
||||
service { 'cgconfig':
|
||||
enable => true,
|
||||
ensure => running,
|
||||
enable => true,
|
||||
require => Package['cgroup-bin'],
|
||||
subscribe => File['/etc/cgconfig.conf']
|
||||
subscribe => File['/etc/cgconfig.conf'],
|
||||
}
|
||||
|
||||
service { 'cgred':
|
||||
enable => true,
|
||||
ensure => running,
|
||||
enable => true,
|
||||
require => Package['cgroup-bin'],
|
||||
subscribe => File['/etc/cgrules.conf']
|
||||
subscribe => File['/etc/cgrules.conf'],
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,13 @@
|
||||
class jenkins::jenkinsuser($ensure = present, $sudo = false, $ssh_key) {
|
||||
# == Class: jenkins::jenkinsuser
|
||||
#
|
||||
class jenkins::jenkinsuser(
|
||||
$ssh_key,
|
||||
$ensure = present,
|
||||
$sudo = false,
|
||||
) {
|
||||
|
||||
group { 'jenkins':
|
||||
ensure => 'present'
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
if ($sudo == true) {
|
||||
@ -11,150 +17,132 @@ class jenkins::jenkinsuser($ensure = present, $sudo = false, $ssh_key) {
|
||||
}
|
||||
|
||||
user { 'jenkins':
|
||||
ensure => 'present',
|
||||
comment => 'Jenkins User',
|
||||
home => '/home/jenkins',
|
||||
gid => 'jenkins',
|
||||
shell => '/bin/bash',
|
||||
ensure => present,
|
||||
comment => 'Jenkins User',
|
||||
home => '/home/jenkins',
|
||||
gid => 'jenkins',
|
||||
shell => '/bin/bash',
|
||||
membership => 'minimum',
|
||||
groups => $groups,
|
||||
require => Group['jenkins']
|
||||
groups => $groups,
|
||||
require => Group['jenkins'],
|
||||
}
|
||||
|
||||
file { 'jenkinshome':
|
||||
name => '/home/jenkins',
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => 644,
|
||||
ensure => 'directory',
|
||||
require => User['jenkins']
|
||||
file { '/home/jenkins':
|
||||
ensure => directory,
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => '0644',
|
||||
require => User['jenkins'],
|
||||
}
|
||||
|
||||
file { 'jenkinspipdir':
|
||||
name => '/home/jenkins/.pip',
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
ensure => 'directory',
|
||||
require => File['jenkinshome'],
|
||||
file { '/home/jenkins/.pip':
|
||||
ensure => directory,
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
require => File['/home/jenkins'],
|
||||
}
|
||||
|
||||
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 { '/home/jenkins/.pip/pip.conf':
|
||||
ensure => present,
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => '0640',
|
||||
source => 'puppet:///modules/jenkins/pip.conf',
|
||||
require => File['/home/jenkins/.pip'],
|
||||
}
|
||||
|
||||
file { 'jenkinspydistutilscfg':
|
||||
name => '/home/jenkins/.pydistutils.cfg',
|
||||
ensure => 'absent',
|
||||
require => File['jenkinshome'],
|
||||
file { '/home/jenkins/.pydistutils.cfg':
|
||||
ensure => absent,
|
||||
require => File['/home/jenkins'],
|
||||
}
|
||||
|
||||
file { 'jenkinsgitconfig':
|
||||
name => '/home/jenkins/.gitconfig',
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => 640,
|
||||
ensure => 'present',
|
||||
source => "puppet:///modules/jenkins/gitconfig",
|
||||
require => File['jenkinshome'],
|
||||
file { '/home/jenkins/.gitconfig':
|
||||
ensure => present,
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => '0640',
|
||||
source => 'puppet:///modules/jenkins/gitconfig',
|
||||
require => File['/home/jenkins'],
|
||||
}
|
||||
|
||||
file { 'jenkinssshdir':
|
||||
name => '/home/jenkins/.ssh',
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => 600,
|
||||
ensure => 'directory',
|
||||
require => File['jenkinshome'],
|
||||
file { '/home/jenkins/.ssh':
|
||||
ensure => directory,
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => '0600',
|
||||
require => File['/home/jenkins'],
|
||||
}
|
||||
|
||||
file { 'jenkinskeys':
|
||||
name => '/home/jenkins/.ssh/authorized_keys',
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => 640,
|
||||
content => "${ssh_key}",
|
||||
ensure => 'present',
|
||||
require => File['jenkinssshdir'],
|
||||
file { '/home/jenkins/.ssh/authorized_keys':
|
||||
ensure => present,
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => '0640',
|
||||
content => $ssh_key,
|
||||
require => File['/home/jenkins/.ssh'],
|
||||
}
|
||||
|
||||
file { 'jenkinsbashrc':
|
||||
name => '/home/jenkins/.bashrc',
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => 640,
|
||||
source => "/etc/skel/.bashrc",
|
||||
replace => 'false',
|
||||
ensure => 'present',
|
||||
file { '/home/jenkins/.bashrc':
|
||||
ensure => present,
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => '0640',
|
||||
source => '/etc/skel/.bashrc',
|
||||
replace => false,
|
||||
require => File['/home/jenkins'],
|
||||
}
|
||||
|
||||
file { 'jenkinsbash_logout':
|
||||
name => '/home/jenkins/.bash_logout',
|
||||
source => "/etc/skel/.bash_logout",
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => 640,
|
||||
replace => 'false',
|
||||
ensure => 'present',
|
||||
file { '/home/jenkins/.bash_logout':
|
||||
ensure => present,
|
||||
source => '/etc/skel/.bash_logout',
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => '0640',
|
||||
replace => false,
|
||||
require => File['/home/jenkins'],
|
||||
}
|
||||
|
||||
file { 'jenkinsprofile':
|
||||
name => '/home/jenkins/.profile',
|
||||
source => "/etc/skel/.profile",
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => 640,
|
||||
replace => 'false',
|
||||
ensure => 'present',
|
||||
file { '/home/jenkins/.profile':
|
||||
ensure => present,
|
||||
source => '/etc/skel/.profile',
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => '0640',
|
||||
replace => false,
|
||||
require => File['/home/jenkins'],
|
||||
}
|
||||
|
||||
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 { '/home/jenkins/.ssh/config':
|
||||
ensure => present,
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => '0640',
|
||||
require => File['/home/jenkins/.ssh'],
|
||||
source => 'puppet:///modules/jenkins/ssh_config',
|
||||
}
|
||||
|
||||
file { 'jenkinsgpgdir':
|
||||
name => '/home/jenkins/.gnupg',
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => 700,
|
||||
ensure => 'directory',
|
||||
require => File['jenkinshome'],
|
||||
file { '/home/jenkins/.gnupg':
|
||||
ensure => directory,
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => '0700',
|
||||
require => File['/home/jenkins'],
|
||||
}
|
||||
|
||||
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 { '/home/jenkins/.gnupg/pubring.gpg':
|
||||
ensure => present,
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => '0600',
|
||||
require => File['/home/jenkins/.gnupg'],
|
||||
source => 'puppet:///modules/jenkins/pubring.gpg',
|
||||
}
|
||||
|
||||
file { 'jenkinsconfigdir':
|
||||
name => '/home/jenkins/.config',
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => 755,
|
||||
ensure => 'directory',
|
||||
require => File['jenkinshome'],
|
||||
file { '/home/jenkins/.config':
|
||||
ensure => directory,
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => '0755',
|
||||
require => File['/home/jenkins'],
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,61 +1,62 @@
|
||||
# == Class: jenkins::job_builder
|
||||
#
|
||||
class jenkins::job_builder (
|
||||
$url,
|
||||
$username,
|
||||
$password,
|
||||
$url,
|
||||
$username,
|
||||
$password,
|
||||
) {
|
||||
|
||||
# A lot of things need yaml, be conservative requiring this package to avoid
|
||||
# conflicts with other modules.
|
||||
if ! defined(Package['python-yaml']) {
|
||||
package { 'python-yaml':
|
||||
ensure => "present",
|
||||
}
|
||||
}
|
||||
|
||||
if ! defined(Package['python-jenkins']) {
|
||||
package { "python-jenkins":
|
||||
ensure => present,
|
||||
}
|
||||
}
|
||||
|
||||
vcsrepo { "/opt/jenkins_job_builder":
|
||||
ensure => latest,
|
||||
if ! defined(Package['python-jenkins']) {
|
||||
package { 'python-jenkins':
|
||||
ensure => present,
|
||||
}
|
||||
}
|
||||
|
||||
vcsrepo { '/opt/jenkins_job_builder':
|
||||
ensure => latest,
|
||||
provider => git,
|
||||
revision => "master",
|
||||
source => "https://github.com/openstack-ci/jenkins-job-builder.git",
|
||||
revision => 'master',
|
||||
source => 'https://github.com/openstack-ci/jenkins-job-builder.git',
|
||||
}
|
||||
|
||||
exec { "install_jenkins_job_builder":
|
||||
command => "python setup.py install",
|
||||
cwd => "/opt/jenkins_job_builder",
|
||||
path => "/bin:/usr/bin",
|
||||
exec { 'install_jenkins_job_builder':
|
||||
command => 'python setup.py install',
|
||||
cwd => '/opt/jenkins_job_builder',
|
||||
path => '/bin:/usr/bin',
|
||||
refreshonly => true,
|
||||
subscribe => Vcsrepo["/opt/jenkins_job_builder"],
|
||||
subscribe => Vcsrepo['/opt/jenkins_job_builder'],
|
||||
}
|
||||
|
||||
file { "/etc/jenkins_jobs":
|
||||
ensure => "directory",
|
||||
file { '/etc/jenkins_jobs':
|
||||
ensure => directory,
|
||||
}
|
||||
|
||||
exec { "jenkins_jobs_update":
|
||||
command => "jenkins-jobs update /etc/jenkins_jobs/config",
|
||||
path => '/bin:/usr/bin:/usr/local/bin',
|
||||
exec { 'jenkins_jobs_update':
|
||||
command => 'jenkins-jobs update /etc/jenkins_jobs/config',
|
||||
path => '/bin:/usr/bin:/usr/local/bin',
|
||||
refreshonly => true,
|
||||
require => [
|
||||
require => [
|
||||
File['/etc/jenkins_jobs/jenkins_jobs.ini'],
|
||||
Package['python-jenkins'],
|
||||
Package['python-yaml']
|
||||
]
|
||||
Package['python-yaml'],
|
||||
]
|
||||
}
|
||||
|
||||
# TODO: We should put in notify Exec['jenkins_jobs_update']
|
||||
# at some point, but that still has some problems.
|
||||
file { "/etc/jenkins_jobs/jenkins_jobs.ini":
|
||||
owner => 'jenkins',
|
||||
mode => 400,
|
||||
ensure => 'present',
|
||||
file { '/etc/jenkins_jobs/jenkins_jobs.ini':
|
||||
ensure => present,
|
||||
owner => 'jenkins',
|
||||
mode => '0400',
|
||||
content => template('jenkins/jenkins_jobs.ini.erb'),
|
||||
require => File["/etc/jenkins_jobs"],
|
||||
require => File['/etc/jenkins_jobs'],
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,48 +1,50 @@
|
||||
# == Class: jenkins::master
|
||||
#
|
||||
class jenkins::master(
|
||||
$vhost_name=$fqdn,
|
||||
$serveradmin="webmaster@$fqdn",
|
||||
$logo,
|
||||
$ssl_cert_file='',
|
||||
$ssl_key_file='',
|
||||
$ssl_chain_file='',
|
||||
$ssl_cert_file_contents='', # If left empty puppet will not create file.
|
||||
$ssl_key_file_contents='', # If left empty puppet will not create file.
|
||||
$ssl_chain_file_contents='' # If left empty puppet will not create file.
|
||||
$vhost_name = $::fqdn,
|
||||
$serveradmin = "webmaster@${::fqdn}",
|
||||
$ssl_cert_file = '',
|
||||
$ssl_key_file = '',
|
||||
$ssl_chain_file = '',
|
||||
$ssl_cert_file_contents = '', # If left empty puppet will not create file.
|
||||
$ssl_key_file_contents = '', # If left empty puppet will not create file.
|
||||
$ssl_chain_file_contents = '', # If left empty puppet will not create file.
|
||||
) {
|
||||
include pip
|
||||
include apt
|
||||
include apache
|
||||
|
||||
#This key is at http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key
|
||||
apt::key { "jenkins":
|
||||
key => "D50582E6",
|
||||
key_source => "http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key",
|
||||
require => Package["wget"]
|
||||
apt::key { 'jenkins':
|
||||
key => 'D50582E6',
|
||||
key_source => 'http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key',
|
||||
require => Package['wget'],
|
||||
}
|
||||
|
||||
apt::source { 'jenkins':
|
||||
location => "http://pkg.jenkins-ci.org/debian",
|
||||
release => "binary/",
|
||||
repos => "",
|
||||
require => Apt::Key['jenkins'],
|
||||
location => 'http://pkg.jenkins-ci.org/debian',
|
||||
release => 'binary/',
|
||||
repos => '',
|
||||
require => Apt::Key['jenkins'],
|
||||
include_src => false,
|
||||
}
|
||||
|
||||
apache::vhost { $vhost_name:
|
||||
port => 443,
|
||||
docroot => 'MEANINGLESS ARGUMENT',
|
||||
port => 443,
|
||||
docroot => 'MEANINGLESS ARGUMENT',
|
||||
priority => '50',
|
||||
template => 'jenkins/jenkins.vhost.erb',
|
||||
ssl => true,
|
||||
ssl => true,
|
||||
}
|
||||
a2mod { 'rewrite':
|
||||
ensure => present
|
||||
ensure => present,
|
||||
}
|
||||
a2mod { 'proxy':
|
||||
ensure => present
|
||||
ensure => present,
|
||||
}
|
||||
a2mod { 'proxy_http':
|
||||
ensure => present
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
if $ssl_cert_file_contents != '' {
|
||||
@ -84,56 +86,56 @@ class jenkins::master(
|
||||
]
|
||||
|
||||
package { $packages:
|
||||
ensure => "present",
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
# devstack-gate
|
||||
if ! defined(Package['python-jenkins']) {
|
||||
package { "python-jenkins":
|
||||
package { 'python-jenkins':
|
||||
ensure => present,
|
||||
}
|
||||
}
|
||||
|
||||
package { "jenkins":
|
||||
ensure => "present",
|
||||
package { 'jenkins':
|
||||
ensure => present,
|
||||
require => Apt::Source['jenkins'],
|
||||
}
|
||||
|
||||
package { "apache-libcloud":
|
||||
ensure => present,
|
||||
package { 'apache-libcloud':
|
||||
ensure => present,
|
||||
provider => pip,
|
||||
require => Class[pip]
|
||||
require => Class[pip],
|
||||
}
|
||||
|
||||
package { "git-review":
|
||||
ensure => latest,
|
||||
package { 'git-review':
|
||||
ensure => latest,
|
||||
provider => pip,
|
||||
require => Class[pip]
|
||||
require => Class[pip],
|
||||
}
|
||||
|
||||
package { "tox":
|
||||
ensure => latest, # okay to use latest for pip
|
||||
provider => pip,
|
||||
require => Class[pip],
|
||||
}
|
||||
|
||||
package { "statsd":
|
||||
package { 'tox':
|
||||
ensure => latest, # okay to use latest for pip
|
||||
provider => pip,
|
||||
require => Class[pip],
|
||||
}
|
||||
|
||||
exec { "update apt cache":
|
||||
subscribe => [ File["/etc/apt/sources.list.d/jenkins.list"]],
|
||||
package { 'statsd':
|
||||
ensure => latest, # okay to use latest for pip
|
||||
provider => pip,
|
||||
require => Class[pip],
|
||||
}
|
||||
|
||||
exec { 'update apt cache':
|
||||
subscribe => File['/etc/apt/sources.list.d/jenkins.list'],
|
||||
refreshonly => true,
|
||||
path => "/bin:/usr/bin",
|
||||
command => "apt-get update",
|
||||
path => '/bin:/usr/bin',
|
||||
command => 'apt-get update',
|
||||
}
|
||||
|
||||
file { '/var/lib/jenkins':
|
||||
ensure => directory,
|
||||
owner => 'jenkins',
|
||||
group => 'adm',
|
||||
ensure => directory,
|
||||
owner => 'jenkins',
|
||||
group => 'adm',
|
||||
require => Package['jenkins'],
|
||||
}
|
||||
|
||||
@ -152,46 +154,44 @@ class jenkins::master(
|
||||
require => File['/var/lib/jenkins/plugins'],
|
||||
}
|
||||
|
||||
file { "/var/lib/jenkins/plugins/simple-theme-plugin/openstack.css":
|
||||
ensure => present,
|
||||
source => "puppet:///modules/jenkins/openstack.css",
|
||||
require => File["/var/lib/jenkins/plugins/simple-theme-plugin"]
|
||||
file { '/var/lib/jenkins/plugins/simple-theme-plugin/openstack.css':
|
||||
ensure => present,
|
||||
source => 'puppet:///modules/jenkins/openstack.css',
|
||||
require => File['/var/lib/jenkins/plugins/simple-theme-plugin'],
|
||||
}
|
||||
|
||||
file { "/var/lib/jenkins/plugins/simple-theme-plugin/openstack.js":
|
||||
ensure => present,
|
||||
content => template("jenkins/openstack.js.erb"),
|
||||
require => File["/var/lib/jenkins/plugins/simple-theme-plugin"]
|
||||
file { '/var/lib/jenkins/plugins/simple-theme-plugin/openstack.js':
|
||||
ensure => present,
|
||||
content => template('jenkins/openstack.js.erb'),
|
||||
require => File['/var/lib/jenkins/plugins/simple-theme-plugin'],
|
||||
}
|
||||
|
||||
file { "/var/lib/jenkins/plugins/simple-theme-plugin/openstack-page-bkg.jpg":
|
||||
ensure => present,
|
||||
source => "puppet:///modules/jenkins/openstack-page-bkg.jpg",
|
||||
require => File["/var/lib/jenkins/plugins/simple-theme-plugin"]
|
||||
file { '/var/lib/jenkins/plugins/simple-theme-plugin/openstack-page-bkg.jpg':
|
||||
ensure => present,
|
||||
source => 'puppet:///modules/jenkins/openstack-page-bkg.jpg',
|
||||
require => File['/var/lib/jenkins/plugins/simple-theme-plugin'],
|
||||
}
|
||||
|
||||
file { "/var/lib/jenkins/plugins/simple-theme-plugin/title.png":
|
||||
ensure => present,
|
||||
source => "puppet:///modules/jenkins/${logo}",
|
||||
require => File["/var/lib/jenkins/plugins/simple-theme-plugin"]
|
||||
file { '/var/lib/jenkins/plugins/simple-theme-plugin/title.png':
|
||||
ensure => present,
|
||||
source => "puppet:///modules/jenkins/${logo}",
|
||||
require => File['/var/lib/jenkins/plugins/simple-theme-plugin'],
|
||||
}
|
||||
|
||||
file { '/usr/local/jenkins':
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => 755,
|
||||
ensure => 'directory',
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
}
|
||||
|
||||
file { '/usr/local/jenkins/slave_scripts':
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => 755,
|
||||
ensure => 'directory',
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
recurse => true,
|
||||
require => File['/usr/local/jenkins'],
|
||||
source => [
|
||||
"puppet:///modules/jenkins/slave_scripts",
|
||||
],
|
||||
source => 'puppet:///modules/jenkins/slave_scripts',
|
||||
}
|
||||
}
|
||||
|
@ -1,192 +1,191 @@
|
||||
class jenkins::slave($ssh_key, $sudo = false, $bare = false, $user = true) {
|
||||
# == Class: jenkins::slave
|
||||
#
|
||||
class jenkins::slave(
|
||||
$ssh_key,
|
||||
$sudo = false,
|
||||
$bare = false,
|
||||
$user = true,
|
||||
) {
|
||||
|
||||
include pip
|
||||
include pip
|
||||
|
||||
if ($user == true) {
|
||||
class { 'jenkins::jenkinsuser':
|
||||
ensure => present,
|
||||
sudo => $sudo,
|
||||
ssh_key => "${ssh_key}"
|
||||
if ($user == true) {
|
||||
class { 'jenkins::jenkinsuser':
|
||||
ensure => present,
|
||||
sudo => $::sudo,
|
||||
ssh_key => $::ssh_key,
|
||||
}
|
||||
}
|
||||
|
||||
# Packages that all jenkins slaves need
|
||||
$common_packages = [
|
||||
'default-jdk', # jdk for building java jobs
|
||||
'build-essential',
|
||||
'ccache',
|
||||
'python-netaddr', # Needed for devstack address_in_net()
|
||||
]
|
||||
|
||||
# Packages that most jenkins slaves (eg, unit test runners) need
|
||||
$standard_packages = [
|
||||
'asciidoc', # for building gerrit/building openstack docs
|
||||
'curl',
|
||||
'docbook-xml', # for building openstack docs
|
||||
'docbook5-xml', # for building openstack docs
|
||||
'docbook-xsl', # for building openstack docs
|
||||
'firefox', # for selenium tests
|
||||
'libapache2-mod-wsgi',
|
||||
'libcurl4-gnutls-dev',
|
||||
'libldap2-dev',
|
||||
'libmysqlclient-dev',
|
||||
'libsqlite3-dev',
|
||||
'libxml2-dev',
|
||||
'libxslt1-dev',
|
||||
'maven2',
|
||||
'pandoc', #for docs, markdown->docbook, bug 924507
|
||||
'pyflakes',
|
||||
'python-libvirt',
|
||||
'python-zmq', # zeromq unittests (not pip installable)
|
||||
'python3-all-dev',
|
||||
'rubygems',
|
||||
'sqlite3',
|
||||
'unzip',
|
||||
'xsltproc', # for building openstack docs
|
||||
'xvfb', # for selenium tests
|
||||
]
|
||||
|
||||
if ($bare == false) {
|
||||
$packages = [$common_packages, $standard_packages]
|
||||
} else {
|
||||
$packages = $common_packages
|
||||
}
|
||||
|
||||
package { $packages:
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
if ($bare == false) {
|
||||
$gem_packages = [
|
||||
'puppet-lint',
|
||||
'puppetlabs_spec_helper',
|
||||
]
|
||||
|
||||
package { $gem_packages:
|
||||
ensure => latest,
|
||||
provider => gem,
|
||||
require => Package['rubygems'],
|
||||
}
|
||||
}
|
||||
|
||||
# Packages that need to be installed from pip
|
||||
$pip_packages = [
|
||||
'setuptools-git',
|
||||
'tox',
|
||||
]
|
||||
|
||||
package { $pip_packages:
|
||||
ensure => latest, # we want the latest from these
|
||||
provider => pip,
|
||||
require => Class[pip],
|
||||
}
|
||||
|
||||
package { 'git-review':
|
||||
ensure => '1.17',
|
||||
provider => pip,
|
||||
require => Class[pip],
|
||||
}
|
||||
|
||||
file { '/etc/profile.d/rubygems.sh':
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
source => 'puppet:///modules/jenkins/rubygems.sh',
|
||||
}
|
||||
|
||||
file { '/usr/local/bin/gcc':
|
||||
ensure => link,
|
||||
target => '/usr/bin/ccache',
|
||||
require => Package['ccache'],
|
||||
}
|
||||
|
||||
file { '/usr/local/bin/g++':
|
||||
ensure => link,
|
||||
target => '/usr/bin/ccache',
|
||||
require => Package['ccache'],
|
||||
}
|
||||
|
||||
file { '/usr/local/bin/cc':
|
||||
ensure => link,
|
||||
target => '/usr/bin/ccache',
|
||||
require => Package['ccache'],
|
||||
}
|
||||
|
||||
file { '/usr/local/bin/c++':
|
||||
ensure => link,
|
||||
target => '/usr/bin/ccache',
|
||||
require => Package['ccache'],
|
||||
}
|
||||
|
||||
if ($bare == false) {
|
||||
class {'mysql::server':
|
||||
config_hash => {
|
||||
'root_password' => 'insecure_slave',
|
||||
'default_engine' => 'MyISAM',
|
||||
'bind_address' => '127.0.0.1',
|
||||
}
|
||||
}
|
||||
include mysql::server::account_security
|
||||
|
||||
# Packages that all jenkins slaves need
|
||||
$common_packages = [
|
||||
"default-jdk", # jdk for building java jobs
|
||||
"build-essential",
|
||||
"ccache",
|
||||
"python-netaddr", # Needed for devstack address_in_net()
|
||||
]
|
||||
|
||||
# Packages that most jenkins slaves (eg, unit test runners) need
|
||||
$standard_packages = [
|
||||
"asciidoc", # for building gerrit/building openstack docs
|
||||
"curl",
|
||||
"docbook-xml", # for building openstack docs
|
||||
"docbook5-xml", # for building openstack docs
|
||||
"docbook-xsl", # for building openstack docs
|
||||
"firefox", # for selenium tests
|
||||
"libapache2-mod-wsgi",
|
||||
"libcurl4-gnutls-dev",
|
||||
"libldap2-dev",
|
||||
"libmysqlclient-dev",
|
||||
"libsqlite3-dev",
|
||||
"libxml2-dev",
|
||||
"libxslt1-dev",
|
||||
"maven2",
|
||||
"pandoc", #for docs, markdown->docbook, bug 924507
|
||||
"python-libvirt",
|
||||
"python-zmq", # zeromq unittests (not pip installable)
|
||||
"python3-all-dev",
|
||||
"rubygems",
|
||||
"sqlite3",
|
||||
"unzip",
|
||||
"xsltproc", # for building openstack docs
|
||||
"xvfb", # for selenium tests
|
||||
"pyflakes"]
|
||||
|
||||
if ($bare == false) {
|
||||
$packages = [$common_packages, $standard_packages]
|
||||
} else {
|
||||
$packages = $common_packages
|
||||
}
|
||||
|
||||
package { $packages:
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
if ($bare == false) {
|
||||
$gem_packages = [
|
||||
'puppet-lint',
|
||||
'puppetlabs_spec_helper',
|
||||
mysql::db { 'openstack_citest':
|
||||
user => 'openstack_citest',
|
||||
password => 'openstack_citest',
|
||||
host => 'localhost',
|
||||
grant => ['all'],
|
||||
require => [
|
||||
Class['mysql::server'],
|
||||
Class['mysql::server::account_security'],
|
||||
]
|
||||
|
||||
package { $gem_packages:
|
||||
ensure => latest,
|
||||
provider => gem,
|
||||
require => Package['rubygems'],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Packages that need to be installed from pip
|
||||
$pip_packages = [
|
||||
"setuptools-git",
|
||||
"tox"]
|
||||
file { '/usr/local/jenkins':
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
}
|
||||
|
||||
package { $pip_packages:
|
||||
ensure => latest, # we want the latest from these
|
||||
provider => pip,
|
||||
require => Class[pip]
|
||||
}
|
||||
file { '/usr/local/jenkins/slave_scripts':
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
recurse => true,
|
||||
require => File['/usr/local/jenkins'],
|
||||
source => 'puppet:///modules/jenkins/slave_scripts',
|
||||
}
|
||||
|
||||
package { 'git-review':
|
||||
ensure => '1.17',
|
||||
provider => pip,
|
||||
require => Class[pip]
|
||||
}
|
||||
file { '/etc/sudoers.d/jenkins-sudo-grep':
|
||||
ensure => present,
|
||||
source => 'puppet:///modules/jenkins/jenkins-sudo-grep.sudo',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0440',
|
||||
}
|
||||
|
||||
file { 'profilerubygems':
|
||||
name => '/etc/profile.d/rubygems.sh',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => 644,
|
||||
ensure => 'present',
|
||||
source => [
|
||||
"puppet:///modules/jenkins/rubygems.sh",
|
||||
],
|
||||
}
|
||||
# Temporary for debugging glance launch problem
|
||||
# https://lists.launchpad.net/openstack/msg13381.html
|
||||
file { '/etc/sysctl.d/10-ptrace.conf':
|
||||
ensure => present,
|
||||
source => 'puppet:///modules/jenkins/10-ptrace.conf',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0444',
|
||||
}
|
||||
|
||||
file { 'ccachegcc':
|
||||
name => '/usr/local/bin/gcc',
|
||||
ensure => link,
|
||||
target => '/usr/bin/ccache',
|
||||
require => Package['ccache'],
|
||||
}
|
||||
|
||||
file { 'ccacheg++':
|
||||
name => '/usr/local/bin/g++',
|
||||
ensure => link,
|
||||
target => '/usr/bin/ccache',
|
||||
require => Package['ccache'],
|
||||
}
|
||||
|
||||
file { 'ccachecc':
|
||||
name => '/usr/local/bin/cc',
|
||||
ensure => link,
|
||||
target => '/usr/bin/ccache',
|
||||
require => Package['ccache'],
|
||||
}
|
||||
|
||||
file { 'ccachec++':
|
||||
name => '/usr/local/bin/c++',
|
||||
ensure => link,
|
||||
target => '/usr/bin/ccache',
|
||||
require => Package['ccache'],
|
||||
}
|
||||
|
||||
|
||||
if ($bare == false) {
|
||||
|
||||
class {'mysql::server':
|
||||
config_hash => {
|
||||
'root_password' => 'insecure_slave',
|
||||
'default_engine' => 'MyISAM',
|
||||
'bind_address' => '127.0.0.1',
|
||||
}
|
||||
}
|
||||
include mysql::server::account_security
|
||||
|
||||
mysql::db { 'openstack_citest':
|
||||
user => 'openstack_citest',
|
||||
password => 'openstack_citest',
|
||||
host => 'localhost',
|
||||
grant => ['all'],
|
||||
require => [Class['mysql::server'],
|
||||
Class['mysql::server::account_security']]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
file { '/usr/local/jenkins':
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => 755,
|
||||
ensure => 'directory',
|
||||
}
|
||||
|
||||
file { '/usr/local/jenkins/slave_scripts':
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => 755,
|
||||
ensure => 'directory',
|
||||
recurse => true,
|
||||
require => File['/usr/local/jenkins'],
|
||||
source => [
|
||||
"puppet:///modules/jenkins/slave_scripts",
|
||||
],
|
||||
}
|
||||
|
||||
file { '/etc/sudoers.d/jenkins-sudo-grep':
|
||||
ensure => present,
|
||||
source => "puppet:///modules/jenkins/jenkins-sudo-grep.sudo",
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => 440,
|
||||
}
|
||||
|
||||
# Temporary for debugging glance launch problem
|
||||
# https://lists.launchpad.net/openstack/msg13381.html
|
||||
file { '/etc/sysctl.d/10-ptrace.conf':
|
||||
ensure => present,
|
||||
source => "puppet:///modules/jenkins/10-ptrace.conf",
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => 444,
|
||||
}
|
||||
|
||||
exec { "ptrace sysctl":
|
||||
subscribe => File['/etc/sysctl.d/10-ptrace.conf'],
|
||||
refreshonly => true,
|
||||
command => "/sbin/sysctl -p /etc/sysctl.d/10-ptrace.conf",
|
||||
}
|
||||
exec { 'ptrace sysctl':
|
||||
subscribe => File['/etc/sysctl.d/10-ptrace.conf'],
|
||||
refreshonly => true,
|
||||
command => '/sbin/sysctl -p /etc/sysctl.d/10-ptrace.conf',
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user