246566d65e
Change-Id: Ia0f3acd50aab07cc83d13cd12c8f7fc67f1c697d Reviewed-on: https://review.openstack.org/10832 Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Approved: Monty Taylor <mordred@inaugust.com> Tested-by: Jenkins
31 lines
829 B
Puppet
31 lines
829 B
Puppet
define planet::site($git_url) {
|
|
|
|
file { "/etc/nginx/sites-available/planet-${name}":
|
|
ensure => present,
|
|
content => template("planet/nginx.erb"),
|
|
replace => true,
|
|
require => Package[nginx],
|
|
notify => Service[nginx]
|
|
}
|
|
|
|
file { "/etc/nginx/sites-enabled/planet-${name}":
|
|
ensure => link,
|
|
target => "/etc/nginx/sites-available/planet-${name}",
|
|
require => Package[nginx],
|
|
}
|
|
|
|
vcsrepo { "/var/lib/planet/${name}":
|
|
ensure => present,
|
|
provider => git,
|
|
source => $git_url,
|
|
require => File['/var/lib/planet'],
|
|
}
|
|
|
|
cron { "update_planet_${name}":
|
|
user => root,
|
|
minute => "*/5",
|
|
command => "date >> /var/log/planet/${name}.log && cd /var/lib/planet/${name} && git pull -q --ff-only && planet /var/lib/planet/${name}/planet.ini >> /var/log/planet/${name}.log 2>&1"
|
|
}
|
|
|
|
}
|