path: root/manifests/profile/base/database/mongodb.pp
diff options
authorJiri Stransky <jistr@redhat.com>2016-09-16 16:41:58 +0200
committerEmilien Macchi <emilien@redhat.com>2016-09-16 16:55:46 -0400
commiteeb4d5f3b1c192e69e92c312652217e606ca8ecb (patch)
treea4bc5665fd950b5594097f06a3406ebe5a428dad /manifests/profile/base/database/mongodb.pp
parent48f965b5edd35f0dae32acf88afa78eef26f6438 (diff)
Wait for MongoDB connections before creating replset
Sometimes the mongodb_replset resource fails with: Could not evaluate: Can't find master host for replicaset tripleo. This issue is intermittent so the fix cannot be perfectly verified, but the assumption is that if we wait for MongoDB to be reachable on all nodes, it will assure that the members will appear to the puppet module as alive when creating or verifying the replset. If the validation fails, it should help us uncover which of the members was causing trouble. Change-Id: I0bcd0d063a7a766483426fdd5ea81cbe1dfaa348 Closes-Bug: #1624420
Diffstat (limited to 'manifests/profile/base/database/mongodb.pp')
1 files changed, 7 insertions, 0 deletions
diff --git a/manifests/profile/base/database/mongodb.pp b/manifests/profile/base/database/mongodb.pp
index 1a19bb6..8967f5b 100644
--- a/manifests/profile/base/database/mongodb.pp
+++ b/manifests/profile/base/database/mongodb.pp
@@ -44,6 +44,13 @@ class tripleo::profile::base::database::mongodb (
include ::tripleo::profile::base::database::mongodbcommon
if $bootstrap_node == $::hostname {
+ # make sure we can connect to all servers before forming the replset
+ tripleo::profile::pacemaker::database::mongodbvalidator {
+ $tripleo::profile::base::database::mongodbcommon::mongodb_node_ips :
+ port => $tripleo::profile::base::database::mongodbcommon::port,
+ require => Service['mongodb'],
+ before => Mongodb_replset[$mongodb_replset],
+ }
mongodb_replset { $mongodb_replset :
members => $tripleo::profile::base::database::mongodbcommon::mongo_node_ips_with_port_nobr,