summaryrefslogtreecommitdiff
path: root/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'puppet')
-rw-r--r--puppet/modules/site_couchdb/manifests/bigcouch/settle_cluster.pp11
-rw-r--r--puppet/modules/site_couchdb/manifests/init.pp3
2 files changed, 14 insertions, 0 deletions
diff --git a/puppet/modules/site_couchdb/manifests/bigcouch/settle_cluster.pp b/puppet/modules/site_couchdb/manifests/bigcouch/settle_cluster.pp
new file mode 100644
index 00000000..aa843e2e
--- /dev/null
+++ b/puppet/modules/site_couchdb/manifests/bigcouch/settle_cluster.pp
@@ -0,0 +1,11 @@
+class site_couchdb::bigcouch::settle_cluster {
+
+ exec { 'wait_for_couch_nodes':
+ command => '/srv/leap/bin/run_tests --test CouchDB/Are_configured_nodes_online? --retry 6 --wait 10'
+ }
+
+ exec { 'settle_cluster_membership':
+ command => '/srv/leap/bin/run_tests --test CouchDB/Is_cluster_membership_ok? --retry 6 --wait 10',
+ require => Exec['wait_for_couch_nodes']
+ }
+}
diff --git a/puppet/modules/site_couchdb/manifests/init.pp b/puppet/modules/site_couchdb/manifests/init.pp
index 2bcd25dc..8c790bd2 100644
--- a/puppet/modules/site_couchdb/manifests/init.pp
+++ b/puppet/modules/site_couchdb/manifests/init.pp
@@ -64,6 +64,7 @@ class site_couchdb {
-> Class['site_couchdb::stunnel']
-> File['/root/.netrc']
-> Class['site_couchdb::bigcouch::add_nodes']
+ -> Class['site_couchdb::bigcouch::settle_cluster']
-> Couchdb::Create_db['users']
-> Couchdb::Create_db['tokens']
-> Couchdb::Add_user[$couchdb_webapp_user]
@@ -73,6 +74,8 @@ class site_couchdb {
class { 'site_couchdb::bigcouch::add_nodes': }
+ class { 'site_couchdb::bigcouch::settle_cluster': }
+
# /etc/couchdb/couchdb.netrc is deployed by couchdb::query::setup
# we symlink this to /root/.netrc for couchdb_scripts (eg. backup)
# and makes life easier for the admin (i.e. using curl/wget without