Cleanup puppet modules

Make files notify services to restart when changed
Improve planet's cron, spit out a date/time and append instead of overwrite log

Change-Id: I0c2ee96c4aff5512a891c49b8b2df5c20c9cab44
This commit is contained in:
Andrew Hutchings 2012-02-06 16:32:34 +00:00
parent b7331f88f3
commit 546136ce52
5 changed files with 14 additions and 12 deletions

View File

@ -28,6 +28,10 @@ class lodgeit {
hasrestart => true
}
service { "nginx":
ensure => running,
hasrestart => true
}
# if we already have the mercurial repo the pull updates
@ -53,8 +57,4 @@ class lodgeit {
onlyif => "test ! -d /var/backups/lodgeit_db"
}
service { 'nginx':
ensure => running,
hasrestart => true
}
}

View File

@ -4,7 +4,8 @@ define lodgeit::site($port, $image="") {
ensure => 'present',
content => template("lodgeit/nginx.erb"),
replace => 'true',
require => Package[nginx]
require => Package[nginx],
notify => Service[nginx]
}
file { "/etc/nginx/sites-enabled/${name}":
@ -17,7 +18,8 @@ define lodgeit::site($port, $image="") {
ensure => 'present',
content => template("lodgeit/upstart.erb"),
replace => 'true',
require => Package[nginx]
require => Package[nginx],
notify => Service["${name}-paste"]
}
file { "/srv/lodgeit/${name}":
@ -36,7 +38,8 @@ define lodgeit::site($port, $image="") {
file { "/srv/lodgeit/${name}/manage.py":
mode => 755,
replace => true,
content => template("lodgeit/manage.py.erb")
content => template("lodgeit/manage.py.erb"),
notify => Service["${name}-paste"]
}
file { "/srv/lodgeit/${name}/lodgeit/views/layout.html":

View File

@ -7,12 +7,10 @@ from lodgeit import local
from lodgeit.application import make_app
from lodgeit.database import session
#dburi = 'sqlite:////tmp/lodgeit.db'
dburi = 'drizzle://127.0.0.1:4427/<%= name %>'
SECRET_KEY = 'no secret key'
def run_app(app, path='/'):
env = create_environ(path, SECRET_KEY)
return run_wsgi_app(app, env)

View File

@ -20,7 +20,7 @@ class planet {
ensure => directory
}
service { 'nginx':
service { "nginx":
ensure => running,
hasrestart => true
}

View File

@ -4,7 +4,8 @@ define planet::site($git_url) {
ensure => present,
content => template("planet/nginx.erb"),
replace => true,
require => Package[nginx]
require => Package[nginx],
notify => Service[nginx]
}
file { "/etc/nginx/sites-enabled/planet-${name}":
@ -33,7 +34,7 @@ define planet::site($git_url) {
cron { "update_planet_${name}":
user => root,
minute => "*/5",
command => "cd /var/lib/planet/${name} && planet /var/lib/planet/${name}/planet.ini > /var/log/planet/${name}.log 2>&1"
command => "date >> /var/log/planet/${name}.log && cd /var/lib/planet/${name} && planet /var/lib/planet/${name}/planet.ini >> /var/log/planet/${name}.log 2>&1"
}
}