summaryrefslogtreecommitdiff
path: root/puppet
diff options
context:
space:
mode:
authorMicah Anderson <micah@leap.se>2014-04-16 16:58:32 -0400
committerMicah Anderson <micah@leap.se>2014-04-17 16:09:41 -0400
commit42d93c7a939902ace20ed5602317530473ece364 (patch)
tree32b8af69589a698443387806bd0affcfdd9f24be /puppet
parent2d64dafaf6238852d80b326ca22359da4371e912 (diff)
add exec resources to run the couchdb tests to wait for nodes and
cluster membership to settle, before attempting any operations (#5269, #4590, #3712) Change-Id: Ic9826dda1c242e705ce85ae218766496bdd8ecbd
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