From 42d93c7a939902ace20ed5602317530473ece364 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 16 Apr 2014 16:58:32 -0400 Subject: 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 --- .../modules/site_couchdb/manifests/bigcouch/settle_cluster.pp | 11 +++++++++++ puppet/modules/site_couchdb/manifests/init.pp | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 puppet/modules/site_couchdb/manifests/bigcouch/settle_cluster.pp (limited to 'puppet/modules') 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 -- cgit v1.2.3