From 46994b7a746ea9c89de74a2e8d4996c21c20af5c Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 3 Feb 2015 21:45:52 +0100 Subject: don't create dbs before couch cluster is settled Change-Id: Ifd665eb7efc06c1cf9e7b8fcfd5f42dbb34ac1b1 --- puppet/modules/site_couchdb/manifests/create_dbs.pp | 1 + 1 file changed, 1 insertion(+) (limited to 'puppet/modules/site_couchdb/manifests/create_dbs.pp') diff --git a/puppet/modules/site_couchdb/manifests/create_dbs.pp b/puppet/modules/site_couchdb/manifests/create_dbs.pp index 4322f773..40148b8e 100644 --- a/puppet/modules/site_couchdb/manifests/create_dbs.pp +++ b/puppet/modules/site_couchdb/manifests/create_dbs.pp @@ -1,6 +1,7 @@ class site_couchdb::create_dbs { Class['site_couchdb::setup'] + -> Class['site_couchdb::bigcouch::settle_cluster'] -> Class['site_couchdb::create_dbs'] # Couchdb databases -- cgit v1.2.3 From b64940c1de7cf42acef018ca2fbf5beff4f48e80 Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 30 Mar 2015 22:33:05 -0700 Subject: added support for rotating couchdb databases. --- puppet/modules/site_couchdb/manifests/create_dbs.pp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'puppet/modules/site_couchdb/manifests/create_dbs.pp') diff --git a/puppet/modules/site_couchdb/manifests/create_dbs.pp b/puppet/modules/site_couchdb/manifests/create_dbs.pp index 40148b8e..f9a08807 100644 --- a/puppet/modules/site_couchdb/manifests/create_dbs.pp +++ b/puppet/modules/site_couchdb/manifests/create_dbs.pp @@ -64,6 +64,13 @@ class site_couchdb::create_dbs { require => Couchdb::Query::Setup['localhost'] } + ## tmp_users database + ## r/w: webapp + couchdb::create_db { 'tmp_users': + members => "{ \"names\": [], \"roles\": [\"replication\", \"users\"] }", + require => Couchdb::Query::Setup['localhost'] + } + ## messages db ## store messages to the clients such as payment reminders ## r/w: webapp -- cgit v1.2.3 From e3cfc2e1e7055ce2640fcce5bf810d6bd7930d2f Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 8 Apr 2015 13:58:41 -0700 Subject: move rotated db creation to site_couchdb and fix rotated db tests --- puppet/modules/site_couchdb/manifests/create_dbs.pp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'puppet/modules/site_couchdb/manifests/create_dbs.pp') 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'] } -- cgit v1.2.3