69255755e0
Change-Id: Ie060ab4ae75b21197d07db78dc3b86370fd0a493
84 lines
2.0 KiB
Puppet
84 lines
2.0 KiB
Puppet
class jenkins_master {
|
|
|
|
#TODO: apache modules: ssl, proxy, rewrite
|
|
#TODO: wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
|
|
#TODO: or something like: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEYID
|
|
|
|
file { '/etc/apt/sources.list.d/jenkins.list':
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => 444,
|
|
ensure => 'present',
|
|
content => "deb http://pkg.jenkins-ci.org/debian binary/",
|
|
replace => 'true',
|
|
}
|
|
|
|
file { '/etc/apache2/sites-available/jenkins':
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => 444,
|
|
ensure => 'present',
|
|
source => "puppet:///modules/jenkins_master/apache.conf",
|
|
replace => 'true',
|
|
require => Package['apache2'],
|
|
}
|
|
|
|
file { '/etc/apache2/sites-enabled/jenkins':
|
|
target => '/etc/apache2/sites-available/jenkins',
|
|
ensure => link,
|
|
require => File['/etc/apache2/sites-available/jenkins'],
|
|
}
|
|
|
|
file { '/etc/apache2/sites-enabled/000-default':
|
|
require => File['/etc/apache2/sites-enabled/jenkins'],
|
|
ensure => absent,
|
|
}
|
|
|
|
$packages = [
|
|
"jenkins",
|
|
"python-pip",
|
|
"apache2"
|
|
]
|
|
|
|
package { $packages:
|
|
ensure => "latest",
|
|
require => File['/etc/apt/sources.list.d/jenkins.list'],
|
|
}
|
|
|
|
service { "versions":
|
|
provider => upstart,
|
|
ensure => running,
|
|
}
|
|
|
|
file { '/etc/init/versions.conf':
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => 444,
|
|
ensure => 'present',
|
|
source => "puppet:///modules/jenkins_master/versions.conf",
|
|
replace => 'true',
|
|
notify => Service["versions"]
|
|
}
|
|
|
|
package { "apache-libcloud":
|
|
ensure => latest,
|
|
provider => pip,
|
|
require => Package[python-pip]
|
|
}
|
|
|
|
exec { "update apt cache":
|
|
subscribe => [ File["/etc/apt/sources.list.d/jenkins.list"]],
|
|
refreshonly => true,
|
|
path => "/bin:/usr/bin",
|
|
command => "apt-get update",
|
|
}
|
|
|
|
exec { "gracefully restart apache":
|
|
subscribe => [ File["/etc/apache2/sites-available/jenkins"]],
|
|
refreshonly => true,
|
|
path => "/bin:/usr/bin:/usr/sbin",
|
|
command => "apache2ctl graceful",
|
|
}
|
|
|
|
}
|