Use puppetlabs apt repo and pin puppet version.

In openstack_project::base use the Apt module to configure the upstream
puppet labs apt repository and pin puppet to version 2.7.*.

Change-Id: I0a09e02e3d26eb9452215e5bccef143487e9e58d
Reviewed-on: https://review.openstack.org/14194
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Clark Boylan 2012-10-08 18:29:01 -07:00 committed by Jenkins
parent e344a65fdb
commit cfb6d326f4
5 changed files with 26 additions and 11 deletions

View File

@ -1,9 +1,16 @@
#!/bin/bash
cat > /etc/apt/preferences.d/00-puppet.pref <<EOF
Package: puppet puppet-common puppetmaster puppetmaster-common
Pin: version 2.7*
Pin-Priority: 501
EOF
lsbdistcodename=`lsb_release -c -s`
puppet_deb=puppetlabs-release-${lsbdistcodename}.deb
wget http://apt.puppetlabs.com/$puppet_deb -O $puppet_deb
dpkg -i $puppet_deb
apt-get update
apt-get install -y puppet git rubygems

View File

@ -77,7 +77,6 @@ class jenkins::master(
$packages = [
'python-babel',
'wget',
]
package { $packages:

View File

@ -41,7 +41,6 @@ class jenkins::slave($ssh_key, $sudo = false, $bare = false, $user = true) {
"rubygems",
"sqlite3",
"unzip",
"wget",
"xsltproc", # for building openstack docs
"xvfb", # for selenium tests
"pyflakes"]

View File

@ -0,0 +1,3 @@
Package: puppet puppet-common puppetmaster puppetmaster-common
Pin: version 2.7*
Pin-Priority: 501

View File

@ -2,6 +2,7 @@ class openstack_project::base(
$certname = $::fqdn,
$install_users = true
) {
include apt
include openstack_project::users
include sudoers
@ -14,7 +15,6 @@ class openstack_project::base(
}
if ($::lsbdistcodename == 'oneiric') {
include apt
apt::ppa { 'ppa:git-core/ppa': }
package { 'git':
ensure => latest,
@ -29,6 +29,7 @@ class openstack_project::base(
$packages = [
'puppet',
'python-setuptools',
'wget',
]
package { $packages:
@ -57,15 +58,21 @@ class openstack_project::base(
)
}
# Download and set up puppet apt repo
exec { "download:puppetlabs-release-$::{lsbdistcodename}.deb":
command => "/usr/bin/wget http://apt.puppetlabs.com/puppetlabs-release-$::{lsbdistcodename}.deb -O /root/puppetlabs-release-$::{lsbdistcodename}.deb",
creates => "/root/puppetlabs-release-$::{lsbdistcodename}.deb",
# Use upstream puppet and pin to version 2.7.*
apt::source { 'puppetlabs':
location => 'http://apt.puppetlabs.com',
repos => 'main',
key => '4BD6EC30',
key_server => 'pgp.mit.edu',
}
exec { "dpkg:puppetlabs-release-$::{lsbdistcodename}.deb":
command => "/usr/bin/dpkg -i /root/puppetlabs-release-$::{lsbdistcodename}.deb",
onlyif => '/usr/bin/test ! -f /etc/apt/sources.list.d/puppetlabs.list',
require => Exec["download:puppetlabs-release-$::{lsbdistcodename}.deb"],
file { '/etc/apt/preferences.d/00-puppet.pref':
ensure => present,
owner => 'root',
group => 'root',
mode => '0444',
source => 'puppet:///modules/openstack_project/00-puppet.pref',
replace => true,
}
file { '/etc/puppet/puppet.conf':