summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2013-05-23 18:03:32 -0400
committerMicah Anderson <micah@riseup.net>2013-05-23 18:03:32 -0400
commit42363772fe4febfd72fc31b809201f562de704cb (patch)
tree7372c1c31ca285d616200a6caf45a19d4b2e5c8e
parentf96d049c407110fb471199ee73c47db8b7cd474a (diff)
parent064195792e264a125b9bd75ff931552af054ecf9 (diff)
Merge remote-tracking branch 'origin/feature/issue_2658' into develop
-rw-r--r--provider_base/services/couchdb.json3
-rw-r--r--puppet/modules/site_couchdb/manifests/bigcouch/add_nodes.pp5
-rw-r--r--puppet/modules/site_couchdb/manifests/init.pp9
3 files changed, 14 insertions, 3 deletions
diff --git a/provider_base/services/couchdb.json b/provider_base/services/couchdb.json
index 43a6c650..ba07733c 100644
--- a/provider_base/services/couchdb.json
+++ b/provider_base/services/couchdb.json
@@ -15,7 +15,8 @@
"bigcouch": {
"epmd_port": 4369,
"ednp_port": 9002,
- "cookie": "= secret :bigcouch_cookie"
+ "cookie": "= secret :bigcouch_cookie",
+ "neighbors": "= nodes_like_me[:services => :couchdb].exclude(self).field('domain.full')"
},
"users": {
"admin": {
diff --git a/puppet/modules/site_couchdb/manifests/bigcouch/add_nodes.pp b/puppet/modules/site_couchdb/manifests/bigcouch/add_nodes.pp
new file mode 100644
index 00000000..241a4914
--- /dev/null
+++ b/puppet/modules/site_couchdb/manifests/bigcouch/add_nodes.pp
@@ -0,0 +1,5 @@
+class site_couchdb::bigcouch::add_nodes {
+ # loop through neighbors array and add nodes
+ $nodes = $::site_couchdb::bigcouch_config['neighbors']
+ couchdb::bigcouch::add_node { $nodes: }
+}
diff --git a/puppet/modules/site_couchdb/manifests/init.pp b/puppet/modules/site_couchdb/manifests/init.pp
index 9f4824b4..802f3224 100644
--- a/puppet/modules/site_couchdb/manifests/init.pp
+++ b/puppet/modules/site_couchdb/manifests/init.pp
@@ -33,9 +33,12 @@ class site_couchdb {
bigcouch_cookie => $bigcouch_cookie,
ednp_port => $ednp_port
}
- include couchdb::bigcouch::package::cloudant
- Service ['couchdb']
+ class { 'couchdb::bigcouch::package::cloudant': }
+
+ Class ['couchdb::bigcouch::package::cloudant']
+ -> Service ['couchdb']
+ -> Class ['site_couchdb::bigcouch::add_nodes']
-> Couchdb::Create_db['users']
-> Couchdb::Create_db['tokens']
-> Couchdb::Add_user[$couchdb_webapp_user]
@@ -47,6 +50,8 @@ class site_couchdb {
ca => $ca
}
+ class { 'site_couchdb::bigcouch::add_nodes': }
+
couchdb::query::setup { 'localhost':
user => $couchdb_admin_user,
pw => $couchdb_admin_pw,