summaryrefslogtreecommitdiffstats
path: root/manifests
diff options
context:
space:
mode:
authorAlex Schultz <aschultz@redhat.com>2016-11-22 10:50:29 -0700
committerAlex Schultz <aschultz@redhat.com>2016-11-22 10:50:29 -0700
commit960ba650670794f0309b1f2e8c4d3707c9ca32e5 (patch)
tree5ac30c20d391070476526c6383cc98a63ea4b553 /manifests
parentcd49ce7f92b3c6c8a99ffa455b160fd0373237e8 (diff)
Update ceilometer collector ipv6 handling
The normalize_ip_for_uri handles ipv6 bracketing correctly. Rather than continue to do it manually, this change updates the ceilometer collector profile to leverage the normalize_ip_for_uri function to properly escape ipv6 addresses. Change-Id: Ifaf6568785235db55f8dc593d83e534216413d31 Closes-Bug: #1629380
Diffstat (limited to 'manifests')
-rw-r--r--manifests/profile/base/ceilometer/collector.pp15
1 files changed, 2 insertions, 13 deletions
diff --git a/manifests/profile/base/ceilometer/collector.pp b/manifests/profile/base/ceilometer/collector.pp
index 3c0a361..20eab54 100644
--- a/manifests/profile/base/ceilometer/collector.pp
+++ b/manifests/profile/base/ceilometer/collector.pp
@@ -68,19 +68,8 @@ class tripleo::profile::base::ceilometer::collector (
if !$mongodb_replset {
fail('mongodb_replset is required when using mongodb')
}
- # NOTE(gfidente): We need to pass the list of IPv6 addresses *with* port
- # and without the brackets as 'members' argument for the 'mongodb_replset'
- # resource.
- if str2bool($mongodb_ipv6) {
- $mongo_node_ips_with_port_prefixed = prefix($mongodb_node_ips, '[')
- $mongo_node_ips_with_port = suffix($mongo_node_ips_with_port_prefixed, ']:27017')
- $mongo_node_ips_with_port_nobr = suffix($mongodb_node_ips, ':27017')
- } else {
- $mongo_node_ips_with_port = suffix($mongodb_node_ips, ':27017')
- $mongo_node_ips_with_port_nobr = suffix($mongodb_node_ips, ':27017')
- }
- $mongo_node_string = join($mongo_node_ips_with_port, ',')
-
+ $mongo_nodes = suffix(any2array(normalize_ip_for_uri($mongodb_node_ips)), ':27017')
+ $mongo_node_string = join($mongo_nodes, ',')
$ceilometer_mongodb_conn_string = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}"
class { '::ceilometer::db' :