Merge "Allow keystone endpoint_type interpolation for reclass models"
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..796cb52
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,4 @@
+[gerrit]
+host=gerrit.mcp.mirantis.net
+port=29418
+project=salt-formulas/horizon.git
diff --git a/horizon/files/horizon_settings/_keystone_settings.py b/horizon/files/horizon_settings/_keystone_settings.py
index 5b4987f..8939e33 100644
--- a/horizon/files/horizon_settings/_keystone_settings.py
+++ b/horizon/files/horizon_settings/_keystone_settings.py
@@ -57,7 +57,7 @@
 # OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
 # in the Keystone service catalog. Use this setting when Horizon is running
 # external to the OpenStack environment. The default is 'publicURL'.
-OPENSTACK_ENDPOINT_TYPE = "publicURL"
+OPENSTACK_ENDPOINT_TYPE = "{{ app.identity.get('endpoint_type', 'publicURL') }}"
 
 # SECONDARY_ENDPOINT_TYPE specifies the fallback endpoint type to use in the
 # case that OPENSTACK_ENDPOINT_TYPE is not present in the endpoints
diff --git a/metadata/service/server/cluster.yml b/metadata/service/server/cluster.yml
index c718ef1..d0e4076 100644
--- a/metadata/service/server/cluster.yml
+++ b/metadata/service/server/cluster.yml
@@ -6,6 +6,7 @@
   _param:
     horizon_version: kilo
     horizon_api_version: 3
+    horizon_identity_endpoint_type: internalURL
   horizon:
     server:
       enabled: true
@@ -33,6 +34,7 @@
         host: ${_param:cluster_vip_address}
         port: 5000
         api_version: 2
+        endpoint_type: ${_param:horizon_identity_endpoint_type}
   haproxy:
     proxy:
       listens:
diff --git a/metadata/service/server/single.yml b/metadata/service/server/single.yml
index f49b9d6..fe119a4 100644
--- a/metadata/service/server/single.yml
+++ b/metadata/service/server/single.yml
@@ -8,6 +8,7 @@
     horizon_identity_host: localhost
     horizon_identity_version: 3
     horizon_identity_encryption: none
+    horizon_identity_endpoint_type: internalURL
   horizon:
     server:
       enabled: true
@@ -34,3 +35,4 @@
         host: ${_param:horizon_identity_host}
         encryption: ${_param:horizon_identity_encryption}
         api_version: ${_param:horizon_identity_version}
+        endpoint_type: ${_param:horizon_identity_endpoint_type}
diff --git a/tests/pillar/cluster.sls b/tests/pillar/cluster.sls
index 8a5c582..7240cdd 100644
--- a/tests/pillar/cluster.sls
+++ b/tests/pillar/cluster.sls
@@ -26,6 +26,7 @@
       port: 5000
       api_version: 2
       encryption: ssl
+      endpoint_type: publicURL
     websso:
       login_url: "WEBROOT + 'auth/login/'"
       logout_url: "WEBROOT + 'auth/logout/'"
diff --git a/tests/pillar/single.sls b/tests/pillar/single.sls
index 9352c62..debbb4a 100644
--- a/tests/pillar/single.sls
+++ b/tests/pillar/single.sls
@@ -24,6 +24,7 @@
       host: 127.0.0.1
       encryption: ssl
       api_version: 2
+      endpoint_type: publicURL
     websso:
       login_url: "WEBROOT + 'auth/login/'"
       logout_url: "WEBROOT + 'auth/logout/'"