Add script for jenkins slave bootstrap.

Change-Id: I7e94193bc81c3caabd77ca112952a98f15f3c434
This commit is contained in:
Monty Taylor 2012-08-01 13:45:10 -05:00
parent 383c023b15
commit 126aaf94b9
4 changed files with 29 additions and 12 deletions

13
install_jenkins_slave.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
lsbdistcodename=`lsb_release -c -s`
puppet_deb=puppetlabs-release-${lsbdistcodename}.deb
/usr/bin/wget http://apt.puppetlabs.com/$puppet_deb -O $puppet_deb
sudo dpkg -i $puppet_deb
sudo apt-get update
sudo apt-get install -y puppet git rubygems
git clone https://github.com/openstack/openstack-ci-puppet
sudo bash openstack-ci-puppet/install_modules.sh
sudo puppet apply --modulepath=`pwd`/openstack-ci-puppet/modules:/etc/puppet/modules -e 'node default {class { "openstack_project::bare_slave": install_users => false }}'

View File

@ -124,5 +124,5 @@ node /^.*\.slave\.openstack\.org$/ {
}
node /^.*\.jclouds\.openstack\.org$/ {
include openstack_project::jclouds_slave
include openstack_project::bare_slave
}

View File

@ -1,7 +1,9 @@
# bare-bones slaves spun up by jclouds. Specifically need to not set ssh
# login limits, because it screws up jclouds provisioning
class openstack_project::jclouds_slave {
include openstack_project::base
class openstack_project::bare_slave($install_users=true) {
class { 'openstack_project::base':
install_users => $install_users
}
class { 'jenkins_slave':
ssh_key => "",

View File

@ -1,4 +1,4 @@
class openstack_project::base {
class openstack_project::base($install_users=true) {
include openstack_project::users
include sudoers
@ -20,14 +20,16 @@ class openstack_project::base {
"emacs23-nox"]
package { $packages: ensure => "present" }
realize (
User::Virtual::Localuser["mordred"],
User::Virtual::Localuser["corvus"],
User::Virtual::Localuser["soren"],
User::Virtual::Localuser["linuxjedi"],
User::Virtual::Localuser["devananda"],
User::Virtual::Localuser["clarkb"],
)
if ($install_useres) {
realize (
User::Virtual::Localuser["mordred"],
User::Virtual::Localuser["corvus"],
User::Virtual::Localuser["soren"],
User::Virtual::Localuser["linuxjedi"],
User::Virtual::Localuser["devananda"],
User::Virtual::Localuser["clarkb"],
)
}
# Download and set up puppet apt repo
exec { "download:puppetlabs-release-${lsbdistcodename}.deb":