summaryrefslogtreecommitdiffstats
path: root/manifests/profile/base
diff options
context:
space:
mode:
authorBrad P. Crochet <brad@redhat.com>2016-10-27 05:04:36 -0400
committerBrad P. Crochet <brad@redhat.com>2016-10-27 05:04:36 -0400
commitd910331e816a16f9fa32eaa25ada5edb9c644f44 (patch)
treefd8c4d362ce4dc92dbccc65fcef5b85a172014b9 /manifests/profile/base
parent6e1d4f3ee0d1e1d2c37169cfb76cb953dc5a2dfd (diff)
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
Diffstat (limited to 'manifests/profile/base')
-rw-r--r--manifests/profile/base/zaqar.pp19
1 files changed, 17 insertions, 2 deletions
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