summaryrefslogtreecommitdiff
path: root/puppet/modules/site_couchdb/manifests/create_dbs.pp
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-04-08 13:58:41 -0700
committerelijah <elijah@riseup.net>2015-04-08 13:58:41 -0700
commite3cfc2e1e7055ce2640fcce5bf810d6bd7930d2f (patch)
tree1ebbfdfa024941e04992eb2daecf22fda014f5dc /puppet/modules/site_couchdb/manifests/create_dbs.pp
parentdbe413c969a54be0a91fe1de1930eb20d885deb6 (diff)
move rotated db creation to site_couchdb and fix rotated db tests
Diffstat (limited to 'puppet/modules/site_couchdb/manifests/create_dbs.pp')
-rw-r--r--puppet/modules/site_couchdb/manifests/create_dbs.pp20
1 files changed, 16 insertions, 4 deletions
diff --git a/puppet/modules/site_couchdb/manifests/create_dbs.pp b/puppet/modules/site_couchdb/manifests/create_dbs.pp
index f9a08807..b743127a 100644
--- a/puppet/modules/site_couchdb/manifests/create_dbs.pp
+++ b/puppet/modules/site_couchdb/manifests/create_dbs.pp
@@ -4,8 +4,6 @@ class site_couchdb::create_dbs {
-> Class['site_couchdb::bigcouch::settle_cluster']
-> Class['site_couchdb::create_dbs']
- # Couchdb databases
-
### customer database
### r/w: webapp,
couchdb::create_db { 'customers':
@@ -30,7 +28,14 @@ class site_couchdb::create_dbs {
## sessions database
## r/w: webapp
- couchdb::create_db { 'sessions':
+ $sessions_db = rotated_db_name('sessions', 'monthly')
+ couchdb::create_db { $sessions_db:
+ members => "{ \"names\": [\"$site_couchdb::couchdb_webapp_user\"], \"roles\": [\"replication\"] }",
+ require => Couchdb::Query::Setup['localhost']
+ }
+
+ $sessions_next_db = rotated_db_name('sessions', 'monthly', 'next')
+ couchdb::create_db { $sessions_next_db:
members => "{ \"names\": [\"$site_couchdb::couchdb_webapp_user\"], \"roles\": [\"replication\"] }",
require => Couchdb::Query::Setup['localhost']
}
@@ -52,7 +57,14 @@ class site_couchdb::create_dbs {
## tokens database
## r: soledad - needs to be restricted with a design document
## r/w: webapp
- couchdb::create_db { 'tokens':
+ $tokens_db = rotated_db_name('tokens', 'monthly')
+ couchdb::create_db { $tokens_db:
+ members => "{ \"names\": [], \"roles\": [\"replication\", \"tokens\"] }",
+ require => Couchdb::Query::Setup['localhost']
+ }
+
+ $tokens_next_db = rotated_db_name('tokens', 'monthly', 'next')
+ couchdb::create_db { $tokens_next_db:
members => "{ \"names\": [], \"roles\": [\"replication\", \"tokens\"] }",
require => Couchdb::Query::Setup['localhost']
}