Aggregate jenkins modules into one module.

Put jenkins_master into jenkins::master and jenkins_job_builder into
jenkins::job_builder and jenkins_slave into jenkins::slave.

Change-Id: Icb0e3071894730c17d8f36f49e9d34979d9c568e
Reviewed-on: https://review.openstack.org/11249
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Monty Taylor 2012-08-04 14:30:15 -05:00 committed by Jenkins
parent be854cd76a
commit e35a6e7c73
55 changed files with 139 additions and 124 deletions

View File

@ -224,7 +224,7 @@ adding the class call below:
.. code-block:: ruby
class { 'jenkins_master':
class { 'jenkins::master':
site => 'jenkins.openstack.org',
serveradmin => 'webmaster@openstack.org',
logo => 'openstack.png'
@ -252,12 +252,12 @@ In the site.pp file the ``logo`` parameter is important:
.. code-block:: ruby
class { 'jenkins_master':
class { 'jenkins::master':
...
logo => 'openstack.png'
}
This relates to a PNG file that must be in the ``modules/jenkins_master/files/``
This relates to a PNG file that must be in the ``modules/jenkins/files/``
directory.
Once puppet installs this and the plugin is installed you need to go into

View File

@ -127,7 +127,7 @@ node /^precise.*\.slave\.openstack\.org$/ {
limit_item => 'nproc',
limit_value => '256'
}
include jenkins_slave::cgroups
include jenkins::cgroups
}
node /^.*\.slave\.openstack\.org$/ {

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -1,4 +1,4 @@
class jenkins_slave::cgroups {
class jenkins::cgroups {
package { 'cgroup-bin':
ensure => present
@ -9,7 +9,7 @@ class jenkins_slave::cgroups {
replace => true,
owner => root,
mode => 0644,
content => template('jenkins_slave/cgconfig.erb')
content => template('jenkins/cgconfig.erb')
}
file { '/etc/cgrules.conf':
@ -17,7 +17,7 @@ class jenkins_slave::cgroups {
replace => true,
owner => root,
mode => 0644,
source => 'puppet:///modules/jenkins_slave/cgroups/cgrules.conf'
source => 'puppet:///modules/jenkins/cgroups/cgrules.conf'
}
service { 'cgconfig':

View File

@ -1,4 +1,4 @@
define jenkinsuser($ensure = present, $sudo = false, $ssh_key) {
define jenkins::jenkinsuser($ensure = present, $sudo = false, $ssh_key) {
group { 'jenkins':
ensure => 'present'
@ -44,7 +44,7 @@ define jenkinsuser($ensure = present, $sudo = false, $ssh_key) {
group => 'jenkins',
mode => 640,
ensure => 'present',
source => "puppet:///modules/jenkins_slave/pip.conf",
source => "puppet:///modules/jenkins/pip.conf",
require => File['jenkinspipdir'],
}
@ -60,7 +60,7 @@ define jenkinsuser($ensure = present, $sudo = false, $ssh_key) {
group => 'jenkins',
mode => 640,
ensure => 'present',
source => "puppet:///modules/jenkins_slave/gitconfig",
source => "puppet:///modules/jenkins/gitconfig",
require => File['jenkinshome'],
}
@ -113,39 +113,6 @@ define jenkinsuser($ensure = present, $sudo = false, $ssh_key) {
ensure => 'present',
}
file { 'jenkinsbazaardir':
name => '/home/jenkins/.bazaar',
owner => 'jenkins',
group => 'jenkins',
mode => 755,
ensure => 'directory',
require => File['jenkinshome'],
}
file { 'jenkinsbazaarwhoami':
name => '/home/jenkins/.bazaar/bazaar.conf',
owner => 'jenkins',
group => 'jenkins',
mode => 640,
ensure => 'present',
require => File['jenkinsbazaardir'],
source => [
"puppet:///modules/jenkins_slave/bazaar.conf",
],
}
file { 'jenkinsbazaarauth':
name => '/home/jenkins/.bazaar/authentication.conf',
owner => 'jenkins',
group => 'jenkins',
mode => 640,
ensure => 'present',
require => File['jenkinsbazaardir'],
source => [
"puppet:///modules/jenkins_slave/authentication.conf",
],
}
file { 'jenkinssshconfig':
name => '/home/jenkins/.ssh/config',
owner => 'jenkins',
@ -154,7 +121,7 @@ define jenkinsuser($ensure = present, $sudo = false, $ssh_key) {
ensure => 'present',
require => File['jenkinssshdir'],
source => [
"puppet:///modules/jenkins_slave/ssh_config",
"puppet:///modules/jenkins/ssh_config",
],
}
@ -166,7 +133,7 @@ define jenkinsuser($ensure = present, $sudo = false, $ssh_key) {
ensure => 'present',
require => File['jenkinssshdir'],
source => [
"puppet:///modules/jenkins_slave/slave_private_key",
"puppet:///modules/jenkins/slave_private_key",
],
}
@ -187,7 +154,7 @@ define jenkinsuser($ensure = present, $sudo = false, $ssh_key) {
ensure => 'present',
require => File['jenkinsgpgdir'],
source => [
"puppet:///modules/jenkins_slave/pubring.gpg",
"puppet:///modules/jenkins/pubring.gpg",
],
}
@ -199,7 +166,7 @@ define jenkinsuser($ensure = present, $sudo = false, $ssh_key) {
ensure => 'present',
require => File['jenkinsgpgdir'],
source => [
"puppet:///modules/jenkins_slave/slave_gpg_key",
"puppet:///modules/jenkins/slave_gpg_key",
],
}
@ -229,7 +196,7 @@ define jenkinsuser($ensure = present, $sudo = false, $ssh_key) {
ensure => 'present',
require => File['jenkinsglanceconfigdir'],
source => [
"puppet:///modules/jenkins_slave/glance_s3.conf",
"puppet:///modules/jenkins/glance_s3.conf",
],
}
@ -241,7 +208,7 @@ define jenkinsuser($ensure = present, $sudo = false, $ssh_key) {
ensure => 'present',
require => File['jenkinsglanceconfigdir'],
source => [
"puppet:///modules/jenkins_slave/glance_swift.conf",
"puppet:///modules/jenkins/glance_swift.conf",
],
}

View File

@ -0,0 +1,57 @@
class jenkins::job_builder (
$url,
$username,
$password,
) {
package { 'python-yaml':
ensure => "present",
}
package { "python-jenkins":
ensure => latest, # okay to use latest for pip
provider => pip,
require => Class[pip]
}
vcsrepo { "/opt/jenkins_job_builder":
ensure => latest,
provider => 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",
refreshonly => true,
subscribe => Vcsrepo["/opt/jenkins_job_builder"],
}
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',
refreshonly => true,
require => [
File['/etc/jenkins_jobs/jenkins_jobs.ini'],
Package['python-jenkins'],
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',
content => template('jenkins/jenkins_jobs.ini.erb'),
require => File["/etc/jenkins_jobs"],
}
}

View File

@ -1,4 +1,4 @@
class jenkins_master($vhost_name=$fqdn,
class jenkins::master($vhost_name=$fqdn,
$serveradmin="webmaster@$fqdn",
$logo,
$ssl_cert_file='',
@ -29,7 +29,7 @@ class jenkins_master($vhost_name=$fqdn,
port => 443,
docroot => 'MEANINGLESS ARGUMENT',
priority => '50',
template => 'jenkins_master/jenkins.vhost.erb',
template => 'jenkins/jenkins.vhost.erb',
ssl => true,
}
a2mod { 'rewrite':
@ -66,7 +66,7 @@ class jenkins_master($vhost_name=$fqdn,
group => 'root',
mode => 444,
ensure => 'present',
source => "puppet:///modules/jenkins_master/versions.conf",
source => "puppet:///modules/jenkins/versions.conf",
replace => 'true',
notify => Service["versions"]
}
@ -104,25 +104,25 @@ class jenkins_master($vhost_name=$fqdn,
file { "/var/lib/jenkins/plugins/simple-theme-plugin/openstack.css":
ensure => present,
source => "puppet:///modules/jenkins_master/openstack.css",
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_master/openstack.js.erb"),
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_master/openstack-page-bkg.jpg",
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_master/${logo}",
source => "puppet:///modules/jenkins/${logo}",
require => File["/var/lib/jenkins/plugins/simple-theme-plugin"]
}
@ -141,7 +141,7 @@ class jenkins_master($vhost_name=$fqdn,
recurse => true,
require => File['/usr/local/jenkins'],
source => [
"puppet:///modules/jenkins_slave/slave_scripts",
"puppet:///modules/jenkins/slave_scripts",
],
}
}

View File

@ -1,9 +1,9 @@
class jenkins_slave($ssh_key, $sudo = false, $bare = false, $user = true) {
class jenkins::slave($ssh_key, $sudo = false, $bare = false, $user = true) {
include pip
if ($user == true) {
jenkinsuser { "jenkins":
jenkins::jenkinsuser { "jenkins":
ensure => present,
sudo => $sudo,
ssh_key => "${ssh_key}"
@ -73,7 +73,7 @@ class jenkins_slave($ssh_key, $sudo = false, $bare = false, $user = true) {
mode => 644,
ensure => 'present',
source => [
"puppet:///modules/jenkins_slave/rubygems.sh",
"puppet:///modules/jenkins/rubygems.sh",
],
}
@ -143,7 +143,7 @@ class jenkins_slave($ssh_key, $sudo = false, $bare = false, $user = true) {
recurse => true,
require => File['/usr/local/jenkins'],
source => [
"puppet:///modules/jenkins_slave/slave_scripts",
"puppet:///modules/jenkins/slave_scripts",
],
}
@ -151,7 +151,7 @@ class jenkins_slave($ssh_key, $sudo = false, $bare = false, $user = true) {
# https://lists.launchpad.net/openstack/msg13381.html
file { '/etc/sysctl.d/10-ptrace.conf':
ensure => present,
source => "puppet:///modules/jenkins_slave/10-ptrace.conf",
source => "puppet:///modules/jenkins/10-ptrace.conf",
owner => 'root',
group => 'root',
mode => 444,

View File

@ -0,0 +1,46 @@
<VirtualHost <%= scope.lookupvar("::jenkins::master::vhost_name") %>:80>
ServerAdmin <%= scope.lookupvar("::jenkins::master::serveradmin") %>
ErrorLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("::jenkins::master::vhost_name") %>-error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("::jenkins::master::vhost_name") %>-access.log combined
Redirect / https://<%= scope.lookupvar("::jenkins::master::vhost_name") %>/
</VirtualHost>
<VirtualHost <%= scope.lookupvar("::jenkins::master::vhost_name") %>:443>
ServerName <%= scope.lookupvar("::jenkins::master::vhost_name") %>
ServerAdmin <%= scope.lookupvar("::jenkins::master::serveradmin") %>
ErrorLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("::jenkins::master::vhost_name") %>-ssl-error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("::jenkins::master::vhost_name") %>-ssl-access.log combined
SSLEngine on
SSLCertificateFile <%= scope.lookupvar("::jenkins::master::ssl_cert_file") %>
SSLCertificateKeyFile <%= scope.lookupvar("::jenkins::master::ssl_key_file") %>
<% if scope.lookupvar("::jenkins::master::ssl_chain_file") != "" %>
SSLCertificateChainFile <%= scope.lookupvar("::jenkins::master::ssl_chain_file") %>
<% end %>
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
RewriteEngine on
RewriteCond %{HTTP_HOST} !<%= scope.lookupvar("::jenkins::master::vhost_name") %>
RewriteRule ^.*$ https://<%= scope.lookupvar("::jenkins::master::vhost_name") %>/
RewriteRule /zuul/status http://127.0.0.1:8001/status [P]
ProxyPass / http://127.0.0.1:8080/ retry=0
ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>

View File

@ -1,46 +0,0 @@
<VirtualHost <%= scope.lookupvar("jenkins_master::vhost_name") %>:80>
ServerAdmin <%= scope.lookupvar("jenkins_master::serveradmin") %>
ErrorLog ${APACHE_LOG_DIR}/jenkins_master-error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/jenkins_master-access.log combined
Redirect / https://<%= scope.lookupvar("jenkins_master::vhost_name") %>/
</VirtualHost>
<VirtualHost <%= scope.lookupvar("jenkins_master::vhost_name") %>:443>
ServerName <%= scope.lookupvar("jenkins_master::vhost_name") %>
ServerAdmin <%= scope.lookupvar("jenkins_master::serveradmin") %>
ErrorLog ${APACHE_LOG_DIR}/jenkins_master-ssl-error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/jenkins_master-ssl-access.log combined
SSLEngine on
SSLCertificateFile <%= scope.lookupvar("jenkins_master::ssl_cert_file") %>
SSLCertificateKeyFile <%= scope.lookupvar("jenkins_master::ssl_key_file") %>
<% if scope.lookupvar("jenkins_master::ssl_chain_file") != "" %>
SSLCertificateChainFile <%= scope.lookupvar("jenkins_master::ssl_chain_file") %>
<% end %>
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
RewriteEngine on
RewriteCond %{HTTP_HOST} !<%= scope.lookupvar("jenkins_master::vhost_name") %>
RewriteRule ^.*$ https://<%= scope.lookupvar("jenkins_master::vhost_name") %>/
RewriteRule /zuul/status http://127.0.0.1:8001/status [P]
ProxyPass / http://127.0.0.1:8080/ retry=0
ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>

View File

@ -1,5 +0,0 @@
[Launchpad]
host = .launchpad.net
scheme = ssh
user = hudson-openstack

View File

@ -1,4 +0,0 @@
[DEFAULT]
email = OpenStack Jenkins <jenkins@openstack.org>
launchpad_username = hudson-openstack

View File

@ -5,7 +5,7 @@ class openstack_project::bare_slave($install_users=true) {
install_users => $install_users
}
class { 'jenkins_slave':
class { 'jenkins::slave':
ssh_key => "",
user => false
}

View File

@ -4,7 +4,7 @@ class openstack_project::jenkins($jenkins_jobs_password) {
iptables_public_tcp_ports => [80, 443, 4155]
}
class { 'jenkins_master':
class { '::jenkins::master':
vhost_name => 'jenkins.openstack.org',
serveradmin => 'webmaster@openstack.org',
logo => 'openstack.png',
@ -13,7 +13,7 @@ class openstack_project::jenkins($jenkins_jobs_password) {
ssl_chain_file => '/etc/ssl/certs/intermediate.pem',
}
class { "jenkins_job_builder":
class { "::jenkins::job_builder":
url => "https://jenkins.openstack.org/",
username => "gerrig",
password => $jenkins_jobs_password,

View File

@ -7,7 +7,7 @@ class openstack_project::jenkins_dev {
backup_user => 'bup-jenkins-dev',
backup_server => 'ci-backup-rs-ord.openstack.org'
}
class { 'jenkins_master':
class { '::jenkins::master':
vhost_name => 'jenkins-dev.openstack.org',
serveradmin => 'webmaster@openstack.org',
logo => 'openstack.png',

View File

@ -4,7 +4,7 @@ class openstack_project::pypi {
include openstack_project
# include jenkins slave so that build deps are there for the pip download
class { 'jenkins_slave':
class { 'jenkins::slave':
ssh_key => "",
user => false
}

View File

@ -5,7 +5,7 @@ class openstack_project::slave {
class { 'openstack_project::server':
iptables_public_tcp_ports => []
}
class { 'jenkins_slave':
class { 'jenkins::slave':
ssh_key => $openstack_project::jenkins_ssh_key
}
}

View File

@ -7,7 +7,7 @@ class openstack_project::slave_template(
iptables_public_tcp_ports => [],
install_users => $install_users,
}
class { 'jenkins_slave':
class { 'jenkins::slave':
ssh_key => $ssh_key,
sudo => true,
bare => true