summaryrefslogtreecommitdiff
path: root/puppet/modules/site_webapp/manifests/init.pp
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-03-30 22:33:05 -0700
committerelijah <elijah@riseup.net>2015-03-30 22:33:05 -0700
commitb64940c1de7cf42acef018ca2fbf5beff4f48e80 (patch)
tree13925f4c050d55c413e15307e48cdb803caa5945 /puppet/modules/site_webapp/manifests/init.pp
parent3172444652af71bd771609d6b80258e70cc82ce9 (diff)
added support for rotating couchdb databases.
Diffstat (limited to 'puppet/modules/site_webapp/manifests/init.pp')
-rw-r--r--puppet/modules/site_webapp/manifests/init.pp15
1 files changed, 14 insertions, 1 deletions
diff --git a/puppet/modules/site_webapp/manifests/init.pp b/puppet/modules/site_webapp/manifests/init.pp
index ea64048b..5071d9bc 100644
--- a/puppet/modules/site_webapp/manifests/init.pp
+++ b/puppet/modules/site_webapp/manifests/init.pp
@@ -50,7 +50,7 @@ class site_webapp {
owner => 'leap-webapp',
group => 'leap-webapp',
require => [ User['leap-webapp'], Group['leap-webapp'] ],
- notify => Exec['bundler_update']
+ notify => [ Exec['bundler_update'], Exec['rotate_dbs'] ]
}
exec { 'bundler_update':
@@ -67,6 +67,19 @@ class site_webapp {
notify => Service['apache'];
}
+ # this only needs to be called before the first time the web app is run.
+ # after that, the cron job will take care of running db:rotate regularly.
+ exec { 'rotate_dbs':
+ cwd => '/srv/leap/webapp',
+ command => '/bin/bash -c "RAILS_ENV=production /usr/bin/bundle exec rake db:rotate"',
+ user => 'leap-webapp',
+ timeout => 600,
+ refreshonly => true,
+ require => [
+ Vcsrepo['/srv/leap/webapp'],
+ Class['site_config::ruby::dev']];
+ }
+
#
# NOTE: in order to support a webapp that is running on a subpath and not the
# root of the domain assets:precompile needs to be run with