Merge "Fix stack_name of virtual_mcp11_dvr job"
diff --git a/haproxy/proxy/listen/kubernetes/apiserver.yml b/haproxy/proxy/listen/kubernetes/apiserver.yml
index 8dfcb35..950765f 100644
--- a/haproxy/proxy/listen/kubernetes/apiserver.yml
+++ b/haproxy/proxy/listen/kubernetes/apiserver.yml
@@ -4,8 +4,6 @@
       listen:
         k8s_secure:
           type: kubernetes
-          options:
-            - ssl-hello-chk
           binds:
           - address: ${_param:cluster_vip_address}
             port: 443
@@ -13,15 +11,15 @@
           - name: ${_param:cluster_node01_hostname}
             host: ${_param:cluster_node01_address}
             port: 6443
-            params: check
+            params: check check-ssl verify none
           - name: ${_param:cluster_node02_hostname}
             host: ${_param:cluster_node02_address}
             port: 6443
-            params: check
+            params: check check-ssl verify none
           - name: ${_param:cluster_node03_hostname}
             host: ${_param:cluster_node03_address}
             port: 6443
-            params: check
+            params: check check-ssl verify none
           timeout:
             server: 10m
             client: 10m
diff --git a/jenkins/client/approved_scripts.yml b/jenkins/client/approved_scripts.yml
index 2c6528f..dfcf9ac 100644
--- a/jenkins/client/approved_scripts.yml
+++ b/jenkins/client/approved_scripts.yml
@@ -140,3 +140,4 @@
         - method hudson.model.Actionable getAction java.lang.Class
         - staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods toSorted java.lang.Iterable
         - staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods intersect java.util.List java.lang.Iterable
+        - staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods reverse java.util.List
diff --git a/jenkins/client/job/deploy/k8s_control.yml b/jenkins/client/job/deploy/k8s_control.yml
index f851176..4dba2e7 100644
--- a/jenkins/client/job/deploy/k8s_control.yml
+++ b/jenkins/client/job/deploy/k8s_control.yml
@@ -8,7 +8,7 @@
           display_name: "Deploy - k8s control"
           discard:
             build:
-              keep_num: 20
+              keep_num: 50
           concurrent: false
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/kqueen.yml b/jenkins/client/job/deploy/kqueen.yml
index 817eb8f..06b449b 100644
--- a/jenkins/client/job/deploy/kqueen.yml
+++ b/jenkins/client/job/deploy/kqueen.yml
@@ -7,7 +7,7 @@
           type: workflow-scm
           discard:
             build:
-              keep_num: 20
+              keep_num: 50
           concurrent: true
           display_name: "Deploy AWS K8S using kqueen"
           scm:
diff --git a/jenkins/client/job/deploy/lab/cleanup.yml b/jenkins/client/job/deploy/lab/cleanup.yml
index 93a0818..3f3875f 100644
--- a/jenkins/client/job/deploy/lab/cleanup.yml
+++ b/jenkins/client/job/deploy/lab/cleanup.yml
@@ -8,7 +8,7 @@
           display_name: "Deploy - stack cleanup"
           discard:
             build:
-              keep_num: 20
+              keep_num: 50
           scm:
             type: git
             url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
diff --git a/jenkins/client/job/deploy/lab/deploy.yml b/jenkins/client/job/deploy/lab/deploy.yml
index b6bbc71..9a04876 100644
--- a/jenkins/client/job/deploy/lab/deploy.yml
+++ b/jenkins/client/job/deploy/lab/deploy.yml
@@ -11,7 +11,7 @@
             type: workflow-scm
             discard:
               build:
-                keep_num: 20
+                keep_num: 100
             concurrent: true
             display_name: "Deploy - {{stack_name}} {{stack_type}}"
             scm:
@@ -100,7 +100,7 @@
                 description: "Formulas revision to install on Salt Master bootstrap stage"
               EXTRA_FORMULAS:
                 type: string
-                default: "maas memcached ntp nginx collectd sensu heka sphinx mysql grafana libvirt rsyslog glusterfs postfix xtrabackup freeipa prometheus telegraf elasticsearch kibana rundeck devops-portal rsync docker keepalived aptly jenkins gerrit artifactory influxdb horizon ceph"
+                default: ""
               STATIC_MGMT_NETWORK:
                   type: boolean
                   default: 'false'
@@ -180,3 +180,32 @@
                 description: "Run tests matched to pattern only"
                 default: ""
 
+              # TestRail vars
+              TESTRAIL_REPORT:
+                type: boolean
+                description: "Report test results to TestRail if true"
+                default: "false"
+              TESTRAIL_REPORTER_IMAGE:
+                type: string
+                description: "Testrail reporter docker image"
+                default: "alrem/xunit2testrail"
+              TESTRAIL_QA_CREDENTIALS:
+                type: string
+                description: "Credentials for results upload to testrail"
+                default: "oscore-qa-credentials"
+              TESTRAIL_MILESTONE:
+                type: string
+                description: "TestRail milestone"
+                default: "MCP1.1"
+              TESTRAIL_PLAN:
+                type: string
+                description: "TestRail test plan name. Will be generated if missing."
+                default: ""
+              TESTRAIL_GROUP:
+                type: string
+                description: "TestRail test group name."
+                default: "{{stack_name}}"
+              TESTRAIL_SUITE:
+                type: string
+                description: "TestRail test suite name"
+                default: "Tempest 16.0.0 with designate tests"
diff --git a/jenkins/client/job/deploy/openstack.yml b/jenkins/client/job/deploy/openstack.yml
index 3595e01..c507824 100644
--- a/jenkins/client/job/deploy/openstack.yml
+++ b/jenkins/client/job/deploy/openstack.yml
@@ -8,7 +8,7 @@
           display_name: "Deploy - OpenStack"
           discard:
             build:
-              keep_num: 20
+              keep_num: 50
           concurrent: true
           scm:
             type: git
diff --git a/jenkins/client/job/deploy/test.yml b/jenkins/client/job/deploy/test.yml
index c226fbc..acf6fa3 100644
--- a/jenkins/client/job/deploy/test.yml
+++ b/jenkins/client/job/deploy/test.yml
@@ -7,7 +7,7 @@
           type: workflow-scm
           discard:
             build:
-              keep_num: 20
+              keep_num: 50
           concurrent: true
           display_name: "Deploy - Test services in environment"
           scm:
diff --git a/jenkins/client/job/k8s-test/mcp-k8s-test-pipeline.yml b/jenkins/client/job/k8s-test/mcp-k8s-test-pipeline.yml
index 8490ee7..36e1dc0 100644
--- a/jenkins/client/job/k8s-test/mcp-k8s-test-pipeline.yml
+++ b/jenkins/client/job/k8s-test/mcp-k8s-test-pipeline.yml
@@ -8,7 +8,7 @@
           display_name: "Kubernetes tests pipeline"
           discard:
             build:
-              keep_num: 20
+              keep_num: 50
           concurrent: false
           scm:
             type: git
diff --git a/jenkins/client/job/opencontrail/build/generic.yml b/jenkins/client/job/opencontrail/build/generic.yml
index 699222e..d9be124 100644
--- a/jenkins/client/job/opencontrail/build/generic.yml
+++ b/jenkins/client/job/opencontrail/build/generic.yml
@@ -53,7 +53,7 @@
               branch: R3.2
               ppa: mirantis-opencontrail/opencontrail-3.2
               upload_source_package: true
-              dpdk: contrail_dpdk_2_1
+              dpdk: contrail_dpdk_17_02
               build_trigger: ""
             - buildname: oc32
               os: ubuntu
@@ -61,7 +61,7 @@
               branch: R3.2
               ppa: mirantis-opencontrail/opencontrail-3.2
               upload_source_package: true
-              dpdk: contrail_dpdk_2_1
+              dpdk: contrail_dpdk_17_02
               build_trigger: ""
             - buildname: oc323
               os: ubuntu
diff --git a/jenkins/client/job/salt-models/tests.yml b/jenkins/client/job/salt-models/tests.yml
index 879a1f1..6bf8e5a 100644
--- a/jenkins/client/job/salt-models/tests.yml
+++ b/jenkins/client/job/salt-models/tests.yml
@@ -8,6 +8,11 @@
           name: test-salt-model-{{name}}
           template:
             type: workflow-scm
+            discard:
+              build:
+                keep_num: 50
+              artifact:
+                keep_num: 50
             scm:
               type: git
               url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
@@ -81,6 +86,11 @@
           name: test-salt-model-{{name}}
           template:
             type: workflow-scm
+            discard:
+             build:
+               keep_num: 50
+             artifact:
+               keep_num: 50
             scm:
               type: git
               url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
@@ -119,9 +129,9 @@
           template:
             discard:
              build:
-               keep_num: 20
+               keep_num: 50
              artifact:
-               keep_num: 20
+               keep_num: 50
             type: workflow-scm
             concurrent: true
             scm:
diff --git a/jenkins/client/job/validate.yml b/jenkins/client/job/validate.yml
index ab2dd38..7d2fa9b 100644
--- a/jenkins/client/job/validate.yml
+++ b/jenkins/client/job/validate.yml
@@ -15,9 +15,9 @@
           display_name: "Validate - Openstack"
           discard:
             build:
-              keep_num: 20
+              keep_num: 50
             artifact:
-              keep_num: 20
+              keep_num: 50
           concurrent: false
           scm:
             type: git
diff --git a/keystone/server/wsgi.yml b/keystone/server/wsgi.yml
index f62c1cc..333cb76 100644
--- a/keystone/server/wsgi.yml
+++ b/keystone/server/wsgi.yml
@@ -1,6 +1,10 @@
 classes:
 - system.apache.server.single
 parameters:
+  _param:
+    apache_keystone_ssl:
+      enabled: false
+    apache_keystone_api_host: ${linux:network:fqdn}
   keystone:
     server:
       service_name: apache2
@@ -14,7 +18,8 @@
           type: keystone
           name: wsgi
           host:
-            name: ${linux:network:fqdn}
+            name: ${_param:apache_keystone_api_host}
+          ssl: ${_param:apache_keystone_ssl}
           log:
             custom:
               format: >-
diff --git a/nginx/server/proxy/openstack/barbican.yml b/nginx/server/proxy/openstack/barbican.yml
index 5f658d1..89e5a9c 100644
--- a/nginx/server/proxy/openstack/barbican.yml
+++ b/nginx/server/proxy/openstack/barbican.yml
@@ -1,6 +1,8 @@
 parameters:
   _param:
     nginx_proxy_openstack_api_host: ${_param:cluster_public_host}
+    nginx_proxy_openstack_api_address: 0.0.0.0
+    nginx_proxy_openstack_barbican_host: ${_param:barbican_service_host}
   nginx:
     server:
       enabled: true
@@ -11,10 +13,11 @@
           name: openstack_api_barbican
           check: false
           proxy:
-            host: ${_param:barbican_service_host}
+            host: ${_param:nginx_proxy_openstack_barbican_host}
             port: 9311
             protocol: http
           host:
             name: ${_param:nginx_proxy_openstack_api_host}
             port: 9311
+            address: ${_param:nginx_proxy_openstack_api_address}
           ssl: ${_param:nginx_proxy_ssl}
diff --git a/nginx/server/proxy/openstack/designate.yml b/nginx/server/proxy/openstack/designate.yml
index 29bc390..c238775 100644
--- a/nginx/server/proxy/openstack/designate.yml
+++ b/nginx/server/proxy/openstack/designate.yml
@@ -1,6 +1,8 @@
 parameters:
   _param:
     nginx_proxy_openstack_api_host: ${_param:cluster_public_host}
+    nginx_proxy_openstack_api_address: 0.0.0.0
+    nginx_proxy_openstack_designate_host: ${_param:designate_service_host}
   nginx:
     server:
       enabled: true
@@ -10,10 +12,11 @@
           type: nginx_proxy
           name: openstack_api_designate
           proxy:
-            host: ${_param:nginx_proxy_openstack_api_proxy_host}
+            host: ${_param:nginx_proxy_openstack_designate_host}
             port: 9001
             protocol: http
           host:
             name: ${_param:nginx_proxy_openstack_api_host}
             port: 9001
+            address: ${_param:nginx_proxy_openstack_api_address}
           ssl: ${_param:nginx_proxy_ssl}
diff --git a/nginx/server/proxy/openstack/horizon.yml b/nginx/server/proxy/openstack/horizon.yml
index 13df5cb..03e3f3c 100644
--- a/nginx/server/proxy/openstack/horizon.yml
+++ b/nginx/server/proxy/openstack/horizon.yml
@@ -1,4 +1,8 @@
 parameters:
+  _param:
+    nginx_proxy_openstack_api_host: ${_param:cluster_public_host}
+    nginx_proxy_openstack_api_address: 0.0.0.0
+    nginx_proxy_openstack_horizon_host: ${_param:openstack_proxy_address}
   nginx:
     server:
       enabled: true
@@ -8,11 +12,12 @@
           type: nginx_proxy
           name: horizon
           proxy:
-            host: ${_param:openstack_proxy_address}
+            host: ${_param:nginx_proxy_openstack_horizon_host}
             port: 443
             protocol: https
           host:
-            name: ${_param:cluster_public_host}
+            name: ${_param:nginx_proxy_openstack_api_host}
             port: 443
             protocol: https
+            address: ${_param:nginx_proxy_openstack_api_address}
           ssl: ${_param:nginx_proxy_ssl}
diff --git a/nginx/server/proxy/openstack/placement.yml b/nginx/server/proxy/openstack/placement.yml
new file mode 100644
index 0000000..eda272c
--- /dev/null
+++ b/nginx/server/proxy/openstack/placement.yml
@@ -0,0 +1,22 @@
+parameters:
+  _param:
+    nginx_proxy_openstack_api_host: ${_param:cluster_public_host}
+    nginx_proxy_openstack_api_address: 0.0.0.0
+    nginx_proxy_openstack_placement_host: ${_param:placement_service_host}
+  nginx:
+    server:
+      enabled: true
+      site:
+        nginx_proxy_openstack_api_placement:
+          enabled: true
+          type: nginx_proxy
+          name: openstack_api_placement
+          proxy:
+            host: ${_param:nginx_proxy_openstack_placement_host}
+            port: 8778
+            protocol: http
+          host:
+            name: ${_param:nginx_proxy_openstack_api_host}
+            port: 8778
+            address: ${_param:nginx_proxy_openstack_api_address}
+          ssl: ${_param:nginx_proxy_ssl}
diff --git a/nginx/server/proxy/openstack_api.yml b/nginx/server/proxy/openstack_api.yml
index 4b0b3f4..4f6073d 100644
--- a/nginx/server/proxy/openstack_api.yml
+++ b/nginx/server/proxy/openstack_api.yml
@@ -1,6 +1,13 @@
 parameters:
   _param:
     nginx_proxy_openstack_api_host: ${_param:cluster_public_host}
+    nginx_proxy_openstack_api_address: 0.0.0.0
+    nginx_proxy_openstack_keystone_host: ${_param:keystone_service_host}
+    nginx_proxy_openstack_nova_host: ${_param:nova_service_host}
+    nginx_proxy_openstack_cinder_host: ${_param:cinder_service_host}
+    nginx_proxy_openstack_glance_host: ${_param:glance_service_host}
+    nginx_proxy_openstack_neutron_host: ${_param:neutron_service_host}
+    nginx_proxy_openstack_heat_host: ${_param:heat_service_host}
   nginx:
     server:
       enabled: true
@@ -11,12 +18,13 @@
           name: openstack_api_keystone
           check: false
           proxy:
-            host: ${_param:keystone_service_host}
+            host: ${_param:nginx_proxy_openstack_keystone_host}
             port: 5000
             protocol: http
           host:
             name: ${_param:nginx_proxy_openstack_api_host}
             port: 5000
+            address: ${_param:nginx_proxy_openstack_api_address}
           ssl: ${_param:nginx_proxy_ssl}
         nginx_proxy_openstack_api_keystone_private:
           enabled: true
@@ -24,12 +32,13 @@
           name: openstack_api_keystone_private
           check: false
           proxy:
-            host: ${_param:keystone_service_host}
+            host: ${_param:nginx_proxy_openstack_keystone_host}
             port: 35357
             protocol: http
           host:
             name: ${_param:nginx_proxy_openstack_api_host}
             port: 35357
+            address: ${_param:nginx_proxy_openstack_api_address}
           ssl: ${_param:nginx_proxy_ssl}
         nginx_proxy_openstack_api_nova:
           enabled: true
@@ -37,12 +46,13 @@
           name: openstack_api_nova
           check: false
           proxy:
-            host: ${_param:nova_service_host}
+            host: ${_param:nginx_proxy_openstack_nova_host}
             port: 8774
             protocol: http
           host:
             name: ${_param:nginx_proxy_openstack_api_host}
             port: 8774
+            address: ${_param:nginx_proxy_openstack_api_address}
           ssl: ${_param:nginx_proxy_ssl}
         nginx_proxy_openstack_api_cinder:
           enabled: true
@@ -50,12 +60,13 @@
           name: openstack_api_cinder
           check: false
           proxy:
-            host: ${_param:cinder_service_host}
+            host: ${_param:nginx_proxy_openstack_cinder_host}
             port: 8776
             protocol: http
           host:
             name: ${_param:nginx_proxy_openstack_api_host}
             port: 8776
+            address: ${_param:nginx_proxy_openstack_api_address}
           ssl: ${_param:nginx_proxy_ssl}
         nginx_proxy_openstack_api_glance:
           enabled: true
@@ -64,13 +75,14 @@
           check: false
           underscores_in_headers: true
           proxy:
-            host: ${_param:glance_service_host}
+            host: ${_param:nginx_proxy_openstack_glance_host}
             port: 9292
             protocol: http
             size: 30000m
           host:
             name: ${_param:nginx_proxy_openstack_api_host}
             port: 9292
+            address: ${_param:nginx_proxy_openstack_api_address}
           ssl: ${_param:nginx_proxy_ssl}
         nginx_proxy_openstack_api_neutron:
           enabled: true
@@ -78,36 +90,39 @@
           name: openstack_api_neutron
           check: false
           proxy:
-            host: ${_param:neutron_service_host}
+            host: ${_param:nginx_proxy_openstack_neutron_host}
             port: 9696
             protocol: http
           host:
             name: ${_param:nginx_proxy_openstack_api_host}
             port: 9696
+            address: ${_param:nginx_proxy_openstack_api_address}
           ssl: ${_param:nginx_proxy_ssl}
         nginx_proxy_openstack_api_heat_cloudwatch:
           enabled: true
           type: nginx_proxy
           name: openstack_api_heat_cloudwatch
           proxy:
-            host: ${_param:heat_service_host}
+            host: ${_param:nginx_proxy_openstack_heat_host}
             port: 8003
             protocol: http
           host:
             name: ${_param:nginx_proxy_openstack_api_host}
             port: 8003
+            address: ${_param:nginx_proxy_openstack_api_address}
           ssl: ${_param:nginx_proxy_ssl}
         nginx_proxy_openstack_api_heat_cfn:
           enabled: true
           type: nginx_proxy
           name: openstack_api_heat_cfn
           proxy:
-            host: ${_param:heat_service_host}
+            host: ${_param:nginx_proxy_openstack_heat_host}
             port: 8000
             protocol: http
           host:
             name: ${_param:nginx_proxy_openstack_api_host}
             port: 8000
+            address: ${_param:nginx_proxy_openstack_api_address}
           ssl: ${_param:nginx_proxy_ssl}
         nginx_proxy_openstack_api_heat:
           enabled: true
@@ -115,12 +130,13 @@
           name: openstack_api_heat
           check: false
           proxy:
-            host: ${_param:heat_service_host}
+            host: ${_param:nginx_proxy_openstack_heat_host}
             port: 8004
             protocol: http
           host:
             name: ${_param:nginx_proxy_openstack_api_host}
             port: 8004
+            address: ${_param:nginx_proxy_openstack_api_address}
           ssl: ${_param:nginx_proxy_ssl}
         nginx_proxy_openstack_api_nova_ec2:
           enabled: true
@@ -128,10 +144,11 @@
           name: openstack_api_nova_ec2
           check: false
           proxy:
-            host: ${_param:nova_service_host}
+            host: ${_param:nginx_proxy_openstack_nova_host}
             port: 8773
             protocol: http
           host:
             name: ${_param:nginx_proxy_openstack_api_host}
             port: 8773
+            address: ${_param:nginx_proxy_openstack_api_address}
           ssl: ${_param:nginx_proxy_ssl}