From d910331e816a16f9fa32eaa25ada5edb9c644f44 Mon Sep 17 00:00:00 2001 From: "Brad P. Crochet" Date: Thu, 27 Oct 2016 05:04:36 -0400 Subject: Calculate zaqar mongo from mongodb_node_ips In order to make the zaqar service fully composable, the mongo ips need to be calculated without assuming that mongo and zaqar are on the same node. Change-Id: I0b077e85ba5fcd9fdfd33956cf33ce2403fcb088 --- manifests/profile/base/zaqar.pp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/profile/base/zaqar.pp b/manifests/profile/base/zaqar.pp index 6794742..89a03ad 100644 --- a/manifests/profile/base/zaqar.pp +++ b/manifests/profile/base/zaqar.pp @@ -32,8 +32,23 @@ class tripleo::profile::base::zaqar ( ) { if $step >= 4 { include ::zaqar - include ::zaqar::management::mongodb - include ::zaqar::messaging::mongodb + + if str2bool(hiera('mongodb::server::ipv6', false)) { + $mongo_node_ips_with_port_prefixed = prefix(hiera('mongodb_node_ips'), '[') + $mongo_node_ips_with_port = suffix($mongo_node_ips_with_port_prefixed, ']:27017') + } else { + $mongo_node_ips_with_port = suffix(hiera('mongodb_node_ips'), ':27017') + } + $mongodb_replset = hiera('mongodb::server::replset') + $mongo_node_string = join($mongo_node_ips_with_port, ',') + $database_connection = "mongodb://${mongo_node_string}/zaqar?replicaSet=${mongodb_replset}" + + class { '::zaqar::management::mongodb': + uri => $database_connection, + } + class {'::zaqar::messaging::mongodb': + uri => $database_connection, + } include ::zaqar::transport::websocket include ::zaqar::transport::wsgi -- cgit 1.2.3-korg