Move python-pip include to a class.

You can't have two different classes install the same package (FAIL)
But you can have two different classes include the same class, so
by encapsulating the "install pip" code into a module, we can safely
consume it across multiple modules.

Sometimes I really hate puppet.

Change-Id: I3467c52b6887298c1b4d01a29873c63edf0adfd3
This commit is contained in:
Monty Taylor 2012-07-23 11:54:48 -05:00
parent 5609c50cd5
commit 6bb34219ae
7 changed files with 31 additions and 20 deletions

View File

@ -4,19 +4,12 @@ class github (
$projects = []
) {
package { "python-dev":
ensure => present,
}
package { "python-pip":
ensure => present,
require => Package[python-dev]
}
include pip
package { "PyGithub":
ensure => latest, # okay to use latest for pip
provider => pip,
require => Package[python-pip]
require => Class[pip]
}
group { "github":

View File

@ -1,5 +1,7 @@
class jenkins_jobs($url, $username, $password, $site) {
include pip
package { 'python-yaml':
ensure => 'present'
}
@ -37,7 +39,7 @@ class jenkins_jobs($url, $username, $password, $site) {
package { "python-jenkins":
ensure => latest, # okay to use latest for pip
provider => pip,
require => Package[python-pip],
require => Class[pip]
}
}

View File

@ -4,6 +4,8 @@ class jenkins_master($site, $serveradmin, $logo,
$ssl_chain_file=''
) {
include pip
#This key is at http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key
apt::key { "D50582E6":
keyid => "D50582E6",
@ -87,7 +89,6 @@ class jenkins_master($site, $serveradmin, $logo,
$packages = [
"jenkins",
"python-pip",
"python-babel",
"apache2"
]
@ -115,19 +116,19 @@ class jenkins_master($site, $serveradmin, $logo,
package { "apache-libcloud":
ensure => present,
provider => pip,
require => Package[python-pip]
require => Class[pip]
}
package { "git-review":
ensure => latest,
provider => pip,
require => Package[python-pip]
require => Class[pip]
}
package { "tox":
ensure => latest, # okay to use latest for pip
provider => pip,
require => Package[python-pip],
require => Class[pip],
}
exec { "update apt cache":

View File

@ -1,5 +1,7 @@
class jenkins_slave($ssh_key, $sudo = false, $bare = false, $user = true) {
include pip
if ($user == true) {
jenkinsuser { "jenkins":
ensure => present,
@ -16,7 +18,6 @@ class jenkins_slave($ssh_key, $sudo = false, $bare = false, $user = true) {
"automake",
"ccache",
"devscripts",
"python-pip",
]
# Packages that most jenkins slaves (eg, unit test runners) need
@ -52,7 +53,6 @@ class jenkins_slave($ssh_key, $sudo = false, $bare = false, $user = true) {
"pep8",
"psmisc",
"pylint",
"python-all-dev",
"python-cheetah",
"python-libvirt",
"python-libxml2",
@ -89,7 +89,7 @@ class jenkins_slave($ssh_key, $sudo = false, $bare = false, $user = true) {
package { $pip_packages:
ensure => latest, # we want the latest from these
provider => pip,
require => Package[python-pip],
require => Class[pip]
}
file { 'profilerubygems':

View File

@ -1,7 +1,6 @@
class lodgeit {
$packages = [ "nginx",
"python-imaging",
"python-pip",
"python-jinja2",
"python-pybabel",
"python-werkzeug",
@ -11,12 +10,14 @@ class lodgeit {
"drizzle",
"python-mysqldb" ]
include pip
package { $packages: ensure => present }
package { 'SQLAlchemy':
provider => pip,
ensure => present,
require => Package[python-pip]
require => Class[pip]
}
file { '/srv/lodgeit':

View File

@ -0,0 +1,12 @@
class pip {
package { "python-all-dev":
ensure => present
}
package { "python-pip":
ensure => present,
require => Package[python-all-dev]
}
}

View File

@ -6,6 +6,8 @@ class pypimirror ( $base_url,
$projects = [] )
{
include pip
package { 'nginx':
ensure => present,
}
@ -13,7 +15,7 @@ class pypimirror ( $base_url,
package { 'pip':
ensure => latest, # okay to use latest for pip
provider => 'pip',
require => Package['python-pip'],
require => Class[pip]
}
file { '/usr/local/mirror_scripts':