Merge "Add prometheus monitoring to reclass"
diff --git a/ceph/client/single.yml b/ceph/client/single.yml
index b01458f..6ff7cd8 100644
--- a/ceph/client/single.yml
+++ b/ceph/client/single.yml
@@ -20,10 +20,18 @@
           osd_journal_size: 7500
         mon:
           mon_debug_dump_transactions: False
+        client:
+          rbd_cache_size: 268435456
+          rbd_cache_max_dirty: 134217728
+          rbd_cache_max_dirty_age: 5
+          rbd_cache: True
+      # TODO: Configure these keys on cluster level
       # keyring:
+      #   images:
+      #     key:
       #   object:
-      #     key: 
+      #     key:
       #   cinder:
-      #     key: 
+      #     key:
       #   nova:
-      #     key: 
\ No newline at end of file
+      #     key:
diff --git a/glusterfs/client/volume/aptly.yml b/glusterfs/client/volume/aptly.yml
index 1c252e3..86a1b40 100644
--- a/glusterfs/client/volume/aptly.yml
+++ b/glusterfs/client/volume/aptly.yml
@@ -7,4 +7,4 @@
         aptly:
           path: /srv/volumes/aptly
           server: ${_param:aptly_glusterfs_service_host}
-          opts: 'defaults'
+          opts: "defaults,backup-volfile-servers=${_param:cluster_node01_address}:${_param:cluster_node02_address}:${_param:cluster_node03_address}"
diff --git a/glusterfs/client/volume/artifactory.yml b/glusterfs/client/volume/artifactory.yml
index f9c951e..2d36961 100644
--- a/glusterfs/client/volume/artifactory.yml
+++ b/glusterfs/client/volume/artifactory.yml
@@ -7,4 +7,4 @@
         artifactory:
           path: /srv/volumes/artifactory
           server: ${_param:artifactory_glusterfs_service_host}
-          opts: 'defaults'
+          opts: "defaults,backup-volfile-servers=${_param:cluster_node01_address}:${_param:cluster_node02_address}:${_param:cluster_node03_address}"
diff --git a/glusterfs/client/volume/gerrit.yml b/glusterfs/client/volume/gerrit.yml
index 6199aa6..39e9559 100644
--- a/glusterfs/client/volume/gerrit.yml
+++ b/glusterfs/client/volume/gerrit.yml
@@ -7,6 +7,6 @@
         gerrit:
           path: /srv/volumes/gerrit
           server: ${_param:gerrit_glusterfs_service_host}
-          opts: 'defaults'
+          opts: "defaults,backup-volfile-servers=${_param:cluster_node01_address}:${_param:cluster_node02_address}:${_param:cluster_node03_address}"
           user: 1000
           group: 1000
diff --git a/glusterfs/client/volume/glance.yml b/glusterfs/client/volume/glance.yml
index 66a4166..25cc988 100644
--- a/glusterfs/client/volume/glance.yml
+++ b/glusterfs/client/volume/glance.yml
@@ -9,3 +9,4 @@
           server: ${_param:glance_glusterfs_service_host}
           user: glance
           group: glance
+          opts: "defaults,backup-volfile-servers=${_param:cluster_node01_address}:${_param:cluster_node02_address}:${_param:cluster_node03_address}"
diff --git a/glusterfs/client/volume/jenkins.yml b/glusterfs/client/volume/jenkins.yml
index cb6cea7..8ca47e2 100644
--- a/glusterfs/client/volume/jenkins.yml
+++ b/glusterfs/client/volume/jenkins.yml
@@ -7,6 +7,6 @@
         jenkins:
           path: /srv/volumes/jenkins
           server: ${_param:jenkins_glusterfs_service_host}
-          opts: 'defaults'
+          opts: "defaults,backup-volfile-servers=${_param:cluster_node01_address}:${_param:cluster_node02_address}:${_param:cluster_node03_address}"
           user: 1000
           group: 1000
diff --git a/glusterfs/client/volume/keystone.yml b/glusterfs/client/volume/keystone.yml
index 188ea03..415e93f 100644
--- a/glusterfs/client/volume/keystone.yml
+++ b/glusterfs/client/volume/keystone.yml
@@ -8,4 +8,5 @@
           path: /var/lib/keystone/fernet-keys
           server: ${_param:keystone_glusterfs_service_host}
           user: keystone
-          group: keystone
\ No newline at end of file
+          group: keystone
+          opts: "defaults,backup-volfile-servers=${_param:cluster_node01_address}:${_param:cluster_node02_address}:${_param:cluster_node03_address}"
diff --git a/glusterfs/client/volume/mysql.yml b/glusterfs/client/volume/mysql.yml
index a6458c6..3208a71 100644
--- a/glusterfs/client/volume/mysql.yml
+++ b/glusterfs/client/volume/mysql.yml
@@ -7,4 +7,4 @@
         mysql:
           path: /srv/volumes/mysql
           server: ${_param:mysql_glusterfs_service_host}
-          opts: 'defaults'
+          opts: "defaults,backup-volfile-servers=${_param:cluster_node01_address}:${_param:cluster_node02_address}:${_param:cluster_node03_address}"
diff --git a/glusterfs/client/volume/openldap.yml b/glusterfs/client/volume/openldap.yml
index 792f15f..0de1d10 100644
--- a/glusterfs/client/volume/openldap.yml
+++ b/glusterfs/client/volume/openldap.yml
@@ -7,4 +7,4 @@
         openldap:
           path: /srv/volumes/openldap
           server: ${_param:openldap_glusterfs_service_host}
-          opts: 'defaults'
+          opts: "defaults,backup-volfile-servers=${_param:cluster_node01_address}:${_param:cluster_node02_address}:${_param:cluster_node03_address}"
diff --git a/glusterfs/client/volume/postgresql.yml b/glusterfs/client/volume/postgresql.yml
index d2337e7..087afa9 100644
--- a/glusterfs/client/volume/postgresql.yml
+++ b/glusterfs/client/volume/postgresql.yml
@@ -7,4 +7,4 @@
         postgresql:
           path: /srv/volumes/postgresql
           server: ${_param:postgresql_glusterfs_service_host}
-          opts: 'defaults'
+          opts: "defaults,backup-volfile-servers=${_param:cluster_node01_address}:${_param:cluster_node02_address}:${_param:cluster_node03_address}"
diff --git a/glusterfs/client/volume/registry.yml b/glusterfs/client/volume/registry.yml
index 875895a..2bb5019 100644
--- a/glusterfs/client/volume/registry.yml
+++ b/glusterfs/client/volume/registry.yml
@@ -7,4 +7,4 @@
         registry:
           path: /srv/volumes/registry
           server: ${_param:registry_glusterfs_service_host}
-          opts: 'defaults'
+          opts: "defaults,backup-volfile-servers=${_param:cluster_node01_address}:${_param:cluster_node02_address}:${_param:cluster_node03_address}"
diff --git a/glusterfs/client/volume/salt.yml b/glusterfs/client/volume/salt.yml
index c3a9570..7ed434a 100644
--- a/glusterfs/client/volume/salt.yml
+++ b/glusterfs/client/volume/salt.yml
@@ -7,4 +7,4 @@
         saltmaster:
           path: /etc/salt/pki/master
           server: ${_param:salt_glusterfs_service_host}
-          opts: 'defaults'
+          opts: "defaults,backup-volfile-servers=${_param:cluster_node01_address}:${_param:cluster_node02_address}:${_param:cluster_node03_address}"
diff --git a/jenkins/client/job/aptly.yml b/jenkins/client/job/aptly.yml
index c428b84..d5d8fcdd 100644
--- a/jenkins/client/job/aptly.yml
+++ b/jenkins/client/job/aptly.yml
@@ -71,3 +71,11 @@
               APTLY_URL:
                 type: string
                 default: "${_param:jenkins_aptly_api_url}"
+              COMPONENTS:
+                type: string
+                default: "all"
+                description: "Comma separated list (,)"
+              PACKAGES:
+                type: string
+                default: "all"
+                description: "Comma separated list (,)"
diff --git a/jenkins/client/job/debian/packages/extra.yml b/jenkins/client/job/debian/packages/extra.yml
index 941c9b4..e51354a 100644
--- a/jenkins/client/job/debian/packages/extra.yml
+++ b/jenkins/client/job/debian/packages/extra.yml
@@ -113,3 +113,12 @@
               ARCH:
                 type: string
                 default: "amd64"
+              PPA:
+                type: string
+                default: "mirantis-opencontrail/extra"
+              UPLOAD_PPA:
+                type: boolean
+                default: 'true'
+              UPLOAD_APTLY:
+                type: boolean
+                default: 'true'
diff --git a/jenkins/client/job/debian/packages/horizon/modules.yml b/jenkins/client/job/debian/packages/horizon/modules.yml
index f63032c..30d7c64 100644
--- a/jenkins/client/job/debian/packages/horizon/modules.yml
+++ b/jenkins/client/job/debian/packages/horizon/modules.yml
@@ -80,3 +80,6 @@
               ARCH:
                 type: string
                 default: "amd64"
+              UPLOAD_APTLY:
+                type: boolean
+                default: 'true'
diff --git a/jenkins/client/job/debian/packages/horizon/themes.yml b/jenkins/client/job/debian/packages/horizon/themes.yml
index a8f8ac2..b96a0c6 100644
--- a/jenkins/client/job/debian/packages/horizon/themes.yml
+++ b/jenkins/client/job/debian/packages/horizon/themes.yml
@@ -80,3 +80,6 @@
               ARCH:
                 type: string
                 default: "amd64"
+              UPLOAD_APTLY:
+                type: boolean
+                default: 'true'
\ No newline at end of file
diff --git a/jenkins/client/job/debian/packages/salt-multi.yml b/jenkins/client/job/debian/packages/salt-multi.yml
index f703e7b..d216e9d 100644
--- a/jenkins/client/job/debian/packages/salt-multi.yml
+++ b/jenkins/client/job/debian/packages/salt-multi.yml
@@ -109,3 +109,12 @@
               ARCH:
                 type: string
                 default: "amd64"
+              PPA:
+                type: string
+                default: "salt-formulas/ppa"
+              UPLOAD_PPA:
+                type: boolean
+                default: 'true'
+              UPLOAD_APTLY:
+                type: boolean
+                default: 'true'
\ No newline at end of file
diff --git a/jenkins/client/job/debian/packages/salt.yml b/jenkins/client/job/debian/packages/salt.yml
index 5cbbe7d..5375d60 100644
--- a/jenkins/client/job/debian/packages/salt.yml
+++ b/jenkins/client/job/debian/packages/salt.yml
@@ -408,3 +408,12 @@
               ARCH:
                 type: string
                 default: "amd64"
+              PPA:
+                type: string
+                default: "salt-formulas/ppa"
+              UPLOAD_PPA:
+                type: boolean
+                default: 'true'
+              UPLOAD_APTLY:
+                type: boolean
+                default: 'true'
diff --git a/jenkins/client/job/deploy/init.yml b/jenkins/client/job/deploy/init.yml
index d725c20..102fe73 100644
--- a/jenkins/client/job/deploy/init.yml
+++ b/jenkins/client/job/deploy/init.yml
@@ -1,3 +1,4 @@
 classes:
   - system.jenkins.client.job.deploy.lab
   - system.jenkins.client.job.deploy.update
+  - system.jenkins.client.job.deploy.openstack
diff --git a/jenkins/client/job/deploy/openstack.yml b/jenkins/client/job/deploy/openstack.yml
new file mode 100644
index 0000000..48de021
--- /dev/null
+++ b/jenkins/client/job/deploy/openstack.yml
@@ -0,0 +1,33 @@
+parameters:
+  jenkins:
+    client:
+      job:
+        deploy_openstack:
+          type: workflow-scm
+          name: deploy-openstack
+          display_name: "Deploy - OpenStack"
+          discard:
+            build:
+              keep_num: 20
+          concurrent: true
+          scm:
+            type: git
+            url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
+            credentials: "gerrit"
+            script: lab-pipeline.groovy
+          param:
+            # deployments and test settings
+            STACK_TYPE:
+              type: string
+              default: "physical"
+            INSTALL:
+              type: string
+              default: "core,kvm,openstack,stacklight"
+
+            # salt master
+            SALT_MASTER_CREDENTIALS:
+              type: string
+              default: "salt"
+            SALT_MASTER_URL:
+              type: string
+              default: ""
diff --git a/jenkins/client/job/gating.yml b/jenkins/client/job/gating.yml
index 357bc8e..1024a1e 100644
--- a/jenkins/client/job/gating.yml
+++ b/jenkins/client/job/gating.yml
@@ -44,6 +44,9 @@
               JOBS_NAMESPACE:
                 type: string
                 default: "{{name}}"
+              SKIP_TEST:
+                type: string
+                default: false
               CREDENTIALS_ID:
                 type: string
                 default: "gerrit"
\ No newline at end of file
diff --git a/jenkins/client/job/kill_stuck_jobs.yml b/jenkins/client/job/kill_stuck_jobs.yml
new file mode 100644
index 0000000..57f0b3f
--- /dev/null
+++ b/jenkins/client/job/kill_stuck_jobs.yml
@@ -0,0 +1,25 @@
+parameters:
+  jenkins:
+    client:
+      job:
+        kill-stuck-jobs:
+          name: kill-stuck-jobs
+          discard:
+            build:
+              keep_num: 3
+            artifact:
+              keep_num: 3
+          type: workflow-scm
+          concurrent: true
+          scm:
+            type: git
+            url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
+            credentials: "gerrit"
+            script: abort-long-running-jobs.groovy
+          trigger:
+            timer:
+              spec: "H H * * *"
+          param:
+            MAX_DURATION_IN_HOURS:
+              type: string
+              default: "24"
diff --git a/jenkins/client/job/opencontrail/build/test.yml b/jenkins/client/job/opencontrail/build/test.yml
new file mode 100644
index 0000000..1182746
--- /dev/null
+++ b/jenkins/client/job/opencontrail/build/test.yml
@@ -0,0 +1,127 @@
+parameters:
+  jenkins:
+    client:
+      job_template:
+        test-opencontrail:
+          name: test-opencontrail-{{buildname}}-{{os}}-{{dist}}
+          jobs:
+            - buildname: oc31
+              os: ubuntu
+              dist: trusty
+              branch: R3.1
+            - buildname: oc31
+              os: ubuntu
+              dist: trusty
+              branch: R3.1
+            - buildname: oc311
+              os: ubuntu
+              dist: trusty
+              branch: R3.1.1.x
+            - buildname: oc311
+              os: ubuntu
+              dist: trusty
+              branch: R3.1.1.x
+            - buildname: oc32
+              os: ubuntu
+              dist: trusty
+              branch: R3.2
+            - buildname: oc32
+              os: ubuntu
+              dist: trusty
+              branch: R3.2
+          template:
+            discard:
+             build:
+               keep_num: 5
+             artifact:
+               keep_num: 5
+            type: workflow-scm
+            concurrent: false
+            quiet_period: 120
+            scm:
+              type: git
+              url: "https://github.com/chnyda/contrail-unittest"
+            trigger:
+              gerrit:
+                project:
+                  contrail/contrail-pipeline:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-build:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-controller:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-vrouter:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-third-party:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-generateDS:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-sandesh:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-packages:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-nova-vif-driver:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-neutron-plugin:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-nova-extensions:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-heat:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-web-storage:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-web-server-manager:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-web-controller:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-web-core:
+                    branches:
+                      - "{{branch}}"
+                  contrail/contrail-webui-third-party:
+                    branches:
+                      - "{{branch}}"
+                message:
+                  build_successful: "Build successful"
+                  build_unstable: "Build unstable"
+                  build_failure: "Build failed"
+                event:
+                  ref:
+                    - updated
+            param:
+              SOURCE_URL:
+                type: string
+                default: "${_param:jenkins_gerrit_url}/contrail"
+              SOURCE_BRANCH:
+                type: string
+                default: "{{branch}}"
+              SOURCE_CREDENTIALS:
+                type: string
+                default: "gerrit"
+              KEEP_REPOS:
+                type: boolean
+                default: 'false'
+                description: "Don't cleanup on failure"
+              OS:
+                type: string
+                default: "{{os}}"
+              DIST:
+                type: string
+                default: "{{dist}}"
+              ARCH:
+                type: string
+                default: "amd64"
diff --git a/jenkins/client/job/test_pipelines.yml b/jenkins/client/job/test_pipelines.yml
index 02a64f2..b418626 100644
--- a/jenkins/client/job/test_pipelines.yml
+++ b/jenkins/client/job/test_pipelines.yml
@@ -2,8 +2,8 @@
   jenkins:
     client:
       job:
-        test-mk-pipelines-pipeline:
-          name: test-mk-pipelines
+        test-mk-mk-pipelines:
+          name: test-mk-mk-pipelines
           discard:
             build:
               keep_num: 25
@@ -15,11 +15,11 @@
             type: git
             url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
             credentials: "gerrit"
-            script: git-mirror-2way-pipeline.groovy
+            script: test-groovy-pipeline.groovy
           trigger:
             gerrit:
               project:
-                mk/mk-pipelines":
+                "mk/mk-pipelines":
                   branches:
                     - master
               event:
@@ -37,7 +37,7 @@
               default: "gerrit"
             GRADLE_IMAGE:
               type: string
-              default: niaquinto/gradle
+              default: "niaquinto/gradle"
             GRADLE_CMD:
               type: string
-              default: check
+              default: "check"
diff --git a/jenkins/slave/debian.yml b/jenkins/slave/debian.yml
new file mode 100644
index 0000000..af3c719
--- /dev/null
+++ b/jenkins/slave/debian.yml
@@ -0,0 +1,8 @@
+classes:
+  - system.jenkins.slave
+parameters:
+  linux:
+    system:
+      package:
+        devscripts:
+          version: latest
diff --git a/linux/system/sudo.yml b/linux/system/sudo.yml
index d5badb8..cafd360 100644
--- a/linux/system/sudo.yml
+++ b/linux/system/sudo.yml
@@ -21,6 +21,8 @@
     - /bin/su -
     - /bin/su
     - /usr/sbin/visudo
+    sudo_coreutils_safe:
+    - /usr/bin/less
     sudo_salt_safe:
     - /usr/bin/salt state*
     - /usr/bin/salt service*
diff --git a/openssh/server/team/l1_support.yml b/openssh/server/team/l1_support.yml
index 206291c..d0be2ed 100644
--- a/openssh/server/team/l1_support.yml
+++ b/openssh/server/team/l1_support.yml
@@ -33,6 +33,7 @@
         aliases:
           command:
             L1_SUPPORT_SALT: ${_param:sudo_salt_safe}
+            L1_SUPPORT_COREUTILS: ${_param:sudo_coreutils_safe}
             L1_SUPPORT_SALT_TRUSTED: ${_param:sudo_salt_trusted}
             L1_SUPPORT_RESTRICTED_SHELLS: ${_param:sudo_shells}
             L1_SUPPORT_RESTRICTED: ${_param:sudo_restricted_su}