
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
63 lines
1.3 KiB
Puppet
63 lines
1.3 KiB
Puppet
class lodgeit {
|
|
$packages = [ "nginx",
|
|
"python-imaging",
|
|
"python-jinja2",
|
|
"python-pybabel",
|
|
"python-werkzeug",
|
|
"python-simplejson",
|
|
"python-pygments",
|
|
"mercurial",
|
|
"drizzle",
|
|
"python-mysqldb" ]
|
|
|
|
include pip
|
|
|
|
package { $packages: ensure => present }
|
|
|
|
package { 'SQLAlchemy':
|
|
provider => pip,
|
|
ensure => present,
|
|
require => Class[pip]
|
|
}
|
|
|
|
file { '/srv/lodgeit':
|
|
ensure => directory
|
|
}
|
|
|
|
service { 'drizzle':
|
|
ensure => running,
|
|
hasrestart => true
|
|
}
|
|
|
|
service { "nginx":
|
|
ensure => running,
|
|
hasrestart => true
|
|
}
|
|
|
|
# if we already have the git repo the pull updates
|
|
|
|
exec { "update_lodgeit":
|
|
command => "git pull --ff-only",
|
|
cwd => "/tmp/lodgeit-main",
|
|
path => "/bin:/usr/bin",
|
|
onlyif => "test -d /tmp/lodgeit-main"
|
|
}
|
|
|
|
# otherwise get a new clone of it
|
|
|
|
exec { "get_lodgeit":
|
|
command => "git clone git://github.com/openstack-ci/lodgeit.git /tmp/lodgeit-main",
|
|
path => "/bin:/usr/bin",
|
|
onlyif => "test ! -d /tmp/lodgeit-main"
|
|
}
|
|
|
|
# create initial git DB backup location
|
|
|
|
exec { "create_db_backup":
|
|
command => "git init /var/backups/lodgeit_db",
|
|
path => "/bin:/usr/bin",
|
|
onlyif => "test ! -d /var/backups/lodgeit_db"
|
|
}
|
|
|
|
}
|