diff options
author | elijah <elijah@riseup.net> | 2015-04-08 13:59:18 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2015-04-08 13:59:18 -0700 |
commit | 35df265409732086402dfa172356448d1a5d315b (patch) | |
tree | b93afc9a9003bef439a4a733ee426e4a056bf32e /puppet/modules/site_couchdb/manifests/create_dbs.pp | |
parent | 7bb8b2e0685b3738c7842e86c09b826c2732e8bd (diff) | |
parent | e3cfc2e1e7055ce2640fcce5bf810d6bd7930d2f (diff) |
Merge branch 'bugfix/rotatedb' into develop
Diffstat (limited to 'puppet/modules/site_couchdb/manifests/create_dbs.pp')
-rw-r--r-- | puppet/modules/site_couchdb/manifests/create_dbs.pp | 20 |
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'] } |