Merge "Allow keystone endpoint_type interpolation for Neutron models  - Add 'endpoint_type' identity parameter  - Set 'endpoint_type: internal' as a    default parameter for 'service' reclass model (/metadata/)"
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..5e52b04
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,4 @@
+[gerrit]
+host=gerrit.mcp.mirantis.net
+port=29418
+project=salt-formulas/neutron.git
diff --git a/README.rst b/README.rst
index 34dc657..0fe54e5 100644
--- a/README.rst
+++ b/README.rst
@@ -40,6 +40,7 @@
           user: neutron
           password: pwd
           tenant: service
+          endpoint_type: internal
         message_queue:
           engine: rabbitmq
           host: 127.0.0.1
@@ -98,6 +99,7 @@
           user: neutron
           password: pwd
           tenant: service
+          endpoint_type: internal
         message_queue:
           engine: rabbitmq
           host: 127.0.0.1
@@ -209,6 +211,7 @@
           user: neutron
           password: pwd
           tenant: service
+          endpoint_type: internal
         message_queue:
           engine: rabbitmq
           host: 127.0.0.1
@@ -317,6 +320,7 @@
           user: neutron
           password: pwd
           tenant: service
+          endpoint_type: internal
         message_queue:
           engine: rabbitmq
           host: 127.0.0.1
diff --git a/metadata/service/control/cluster.yml b/metadata/service/control/cluster.yml
index 2a235c1..eaa8707 100644
--- a/metadata/service/control/cluster.yml
+++ b/metadata/service/control/cluster.yml
@@ -3,6 +3,8 @@
 classes:
 - service.neutron.support
 parameters:
+  _param:
+    keystone_neutron_endpoint_type: internal
   neutron:
     server:
       enabled: true
@@ -26,6 +28,7 @@
         user: neutron
         password: ${_param:keystone_neutron_password}
         tenant: service
+        endpoint_type: ${_param:keystone_neutron_endpoint_type}
       message_queue:
         engine: rabbitmq
         host: ${_param:cluster_vip_address}
diff --git a/metadata/service/control/container.yml b/metadata/service/control/container.yml
index 76931da..bca3d9e 100644
--- a/metadata/service/control/container.yml
+++ b/metadata/service/control/container.yml
@@ -1,4 +1,6 @@
 parameters:
+  _param:
+    keystone_neutron_endpoint_type: internal
   kubernetes:
     control:
       configmap:
@@ -29,6 +31,7 @@
                   user: neutron
                   password: ${_param:keystone_neutron_password}
                   tenant: service
+                  endpoint_type: ${_param:keystone_neutron_endpoint_type}
                 message_queue:
                   engine: rabbitmq
                   host: ${_param:rabbitmq_service_host}
diff --git a/metadata/service/control/single.yml b/metadata/service/control/single.yml
index ea2c0f7..3be2831 100644
--- a/metadata/service/control/single.yml
+++ b/metadata/service/control/single.yml
@@ -3,6 +3,8 @@
 classes:
 - service.neutron.support
 parameters:
+  _param:
+    keystone_neutron_endpoint_type: internal
   neutron:
     server:
       enabled: true
@@ -29,6 +31,7 @@
         user: neutron
         password: ${_param:keystone_neutron_password}
         tenant: service
+        endpoint_type: ${_param:keystone_neutron_endpoint_type}
       message_queue:
         engine: rabbitmq
         host: ${_param:single_address}
diff --git a/neutron/files/mitaka/neutron-server.conf.Debian b/neutron/files/mitaka/neutron-server.conf.Debian
index bc05c66..f7f7a58 100644
--- a/neutron/files/mitaka/neutron-server.conf.Debian
+++ b/neutron/files/mitaka/neutron-server.conf.Debian
@@ -1052,7 +1052,7 @@
 # keystone catalog and should be one of public, internal or admin. (string
 # value)
 # Allowed values: public, admin, internal
-#endpoint_type = public
+endpoint_type = {{ server.identity.get('endpoint_type', 'public') }}
 
 #
 # From nova.auth
diff --git a/tests/pillar/control_cluster.sls b/tests/pillar/control_cluster.sls
index 1d21783..1aba7fd 100644
--- a/tests/pillar/control_cluster.sls
+++ b/tests/pillar/control_cluster.sls
@@ -32,6 +32,7 @@
       user: neutron
       password: password
       tenant: service
+      endpoint_type: internal
     message_queue:
       engine: rabbitmq
       members:
diff --git a/tests/pillar/control_dvr.sls b/tests/pillar/control_dvr.sls
index ca2b75e..7684188 100644
--- a/tests/pillar/control_dvr.sls
+++ b/tests/pillar/control_dvr.sls
@@ -35,6 +35,7 @@
       region: RegionOne
       tenant: service
       user: neutron
+      endpoint_type: internal
     l3_ha: false
     message_queue:
       engine: rabbitmq
diff --git a/tests/pillar/control_nodvr.sls b/tests/pillar/control_nodvr.sls
index 4fed20a..154c47e 100644
--- a/tests/pillar/control_nodvr.sls
+++ b/tests/pillar/control_nodvr.sls
@@ -35,6 +35,7 @@
       region: RegionOne
       tenant: service
       user: neutron
+      endpoint_type: internal
     l3_ha: True
     message_queue:
       engine: rabbitmq
diff --git a/tests/pillar/control_single.sls b/tests/pillar/control_single.sls
index 73529cf..1f8a28e 100644
--- a/tests/pillar/control_single.sls
+++ b/tests/pillar/control_single.sls
@@ -32,6 +32,7 @@
       user: neutron
       password: password
       tenant: service
+      endpoint_type: internal
     message_queue:
       engine: rabbitmq
       host: 127.0.0.1