Fix vncproxy_host for IPv6
authorJavier Pena <jpena@redhat.com>
Wed, 2 Mar 2016 09:57:50 +0000 (10:57 +0100)
committerAttila Darazs <adarazs@redhat.com>
Thu, 10 Mar 2016 17:20:57 +0000 (18:20 +0100)
https://review.openstack.org/268356 can cause issues in IPv6
environments. It generates the following Hiera data:

nova::vncproxy::common::vncproxy_host: [2001:db8:fd00:1000::10]

which fails due to the brackets. Making sure there are no brackets
in nova_vncproxy_host makes it work for both the IP case and when
using DNS names.

Change-Id: Iafe18f042725eb9419d97cd674c4b9a1a895b187

puppet/compute.yaml

index cd75683..b1804cf 100644 (file)
@@ -576,7 +576,14 @@ resources:
         cinder_enable_rbd_backend: {get_param: CinderEnableRbdBackend}
         nova_vnc_proxyclient_address: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, NovaVncProxyNetwork]}]}
         nova_vncproxy_protocol: {get_param: [EndpointMap, NovaVNCProxyPublic, protocol]}
-        nova_vncproxy_host: {get_param: [EndpointMap, NovaVNCProxyPublic, host]}
+        # Remove brackets that may come if the IP address is IPv6.
+        # For DNS names and IPv4, this will just get the NovaVNCProxyPublic value
+        nova_vncproxy_host:
+          str_replace:
+            template: {get_param: [EndpointMap, NovaVNCProxyPublic, host]}
+            params:
+              '[': ''
+              ']': ''
         nova_vncproxy_port: {get_param: [EndpointMap, NovaVNCProxyPublic, port]}
         nova_ovs_bridge: {get_param: NovaOVSBridge}
         nova_security_group_api: {get_param: NovaSecurityGroupAPI}