Add planet support
Adds planet module and planet.openstack.org site. Change-Id: Id4d495889346e0a0d85d0fd05e40d451b04d21b1 Note: will not work with current openstack-planet git branch. Update for that comming
This commit is contained in:
parent
c95166994d
commit
950531a299
@ -208,6 +208,15 @@ node "paste.openstack.org" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
node "planet.openstack.org" {
|
||||||
|
include planet
|
||||||
|
|
||||||
|
planet::site { "openstack":
|
||||||
|
git_url => "https://github.com/openstack/openstack-planet.git"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
node "devstack-oneiric.template.openstack.org" {
|
node "devstack-oneiric.template.openstack.org" {
|
||||||
include openstack_template
|
include openstack_template
|
||||||
include devstack_host
|
include devstack_host
|
||||||
|
24
modules/planet/manifests/init.pp
Normal file
24
modules/planet/manifests/init.pp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
class planet {
|
||||||
|
|
||||||
|
package { 'planet-venus':
|
||||||
|
ensure => present
|
||||||
|
}
|
||||||
|
|
||||||
|
package { 'nginx':
|
||||||
|
ensure => present
|
||||||
|
}
|
||||||
|
|
||||||
|
file { '/srv/planet':
|
||||||
|
ensure => directory
|
||||||
|
}
|
||||||
|
|
||||||
|
file { '/var/lib/planet':
|
||||||
|
ensure => directory
|
||||||
|
}
|
||||||
|
|
||||||
|
service { 'nginx':
|
||||||
|
ensure => running,
|
||||||
|
hasrestart => true
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
39
modules/planet/manifests/site.pp
Normal file
39
modules/planet/manifests/site.pp
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
define planet::site($git_url) {
|
||||||
|
|
||||||
|
file { "/etc/nginx/sites-available/planet-${name}":
|
||||||
|
ensure => present,
|
||||||
|
content => template("planet/nginx.erb"),
|
||||||
|
replace => true,
|
||||||
|
require => Package[nginx]
|
||||||
|
}
|
||||||
|
|
||||||
|
file { "/etc/nginx/sites-enabled/planet-${name}":
|
||||||
|
ensure => link,
|
||||||
|
target => "/etc/nginx/sites-available/planet-${name}",
|
||||||
|
require => Package[nginx],
|
||||||
|
}
|
||||||
|
|
||||||
|
# if we already have the mercurial repo the pull updates
|
||||||
|
|
||||||
|
exec { "update_${name}_planet":
|
||||||
|
command => "git pull",
|
||||||
|
cwd => "/var/lib/planet/${name}",
|
||||||
|
path => "/bin:/usr/bin",
|
||||||
|
onlyif => "test -d /var/lib/planet/${name}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# otherwise get a new clone of it
|
||||||
|
|
||||||
|
exec { "create_${name}_planet":
|
||||||
|
command => "git clone ${git_url} /var/lib/planet/${name}",
|
||||||
|
path => "/bin:/usr/bin",
|
||||||
|
onlyif => "test ! -d /var/lib/planet/${name}"
|
||||||
|
}
|
||||||
|
|
||||||
|
cron { "update_planet_${name}":
|
||||||
|
user => root,
|
||||||
|
minute => 3,
|
||||||
|
command => "planet /var/lib/planet/${name}.ini"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
5
modules/planet/templates/nginx.erb
Normal file
5
modules/planet/templates/nginx.erb
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name planet.<%= name %>.org;
|
||||||
|
root /srv/planet/<%= name %>;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user