Merge "Add labels_add parameter for prometheus"
diff --git a/docker/swarm/stack/monitoring.yml b/docker/swarm/stack/monitoring/init.yml
similarity index 98%
rename from docker/swarm/stack/monitoring.yml
rename to docker/swarm/stack/monitoring/init.yml
index a11024d..2cbdfdc 100644
--- a/docker/swarm/stack/monitoring.yml
+++ b/docker/swarm/stack/monitoring/init.yml
@@ -5,6 +5,7 @@
 - service.prometheus.remote_storage_adapter.container
 - system.prometheus.server
 - system.prometheus.alertmanager
+- system.telegraf.agent.remote
 parameters:
   docker:
     client:
diff --git a/docker/swarm/stack/monitoring/remote_collector.yml b/docker/swarm/stack/monitoring/remote_collector.yml
new file mode 100644
index 0000000..ff6af95
--- /dev/null
+++ b/docker/swarm/stack/monitoring/remote_collector.yml
@@ -0,0 +1,29 @@
+classes:
+- system.heka.remote_collector.container
+- system.heka.remote_collector.input.amqp
+- system.heka.remote_collector.output.elasticsearch
+- system.heka.remote_collector.output.telegraf
+- system.telegraf.agent.remote.input.http_listener
+parameters:
+  docker:
+    client:
+      stack:
+        monitoring:
+          service:
+            remote_collector:
+              networks:
+                - monitoring
+              deploy:
+                replicas: 1
+                labels:
+                  com.mirantis.monitoring: "remote_collector"
+                restart_policy:
+                  condition: any
+              labels:
+                com.mirantis.monitoring: "remote_collector"
+              image: ${_param:docker_image_remote_collector}
+              volumes:
+                - ${heka:remote_collector:prefix_dir}/etc/remote_collector:/etc/heka
+                - ${heka:remote_collector:prefix_dir}/usr/share/lma_collector:/usr/share/lma_collector
+              environment:
+                HEKA_CACHE_DIR: /var/cache/remote_collector
diff --git a/docker/swarm/stack/pushkin.yml b/docker/swarm/stack/pushkin.yml
index 3232301..dde8541 100644
--- a/docker/swarm/stack/pushkin.yml
+++ b/docker/swarm/stack/pushkin.yml
@@ -13,6 +13,11 @@
             POSTGRES_DB: ${_param:pushkin_db}
             PUSHKINDBHOST: ${_param:pushkin_db_host}
             PUSHKINELASTICHOST: ${_param:haproxy_elasticsearch_bind_host}
+            WEBHOOK_FROM: ${_param:webhook_from}
+            WEBHOOK_RECIPIENTS: ${_param:webhook_recipients}
+            WEBHOOK_LOGIN_ID: ${_param:webhook_login_id}
+            WEBHOOK_APPLICATION_ID: ${_param:webhook_application_id}
+            WEBHOOK_SFDC_USERNAME: ${_param:webhook_sfdc_username}
           service:
             api:
               image: ${_param:docker_image_pushkin}
diff --git a/heka/remote_collector/container.yml b/heka/remote_collector/container.yml
new file mode 100644
index 0000000..61b8c31
--- /dev/null
+++ b/heka/remote_collector/container.yml
@@ -0,0 +1,9 @@
+classes:
+- service.heka.remote_collector.container
+- system.heka.server
+parameters:
+  _param:
+    remote_collector_prefix_dir: /srv/volumes/local/remote_collector
+  heka:
+    remote_collector:
+      prefix_dir: ${_param:remote_collector_prefix_dir}
\ No newline at end of file
diff --git a/jenkins/client/job/deploy/lab/cicd.yml b/jenkins/client/job/deploy/lab/cicd.yml
index 8a2893c..9002c9c 100644
--- a/jenkins/client/job/deploy/lab/cicd.yml
+++ b/jenkins/client/job/deploy/lab/cicd.yml
@@ -20,7 +20,7 @@
               # heat
               HEAT_TEMPLATE_URL:
                 type: string
-                default: "git@github.com:Mirantis/mk-lab-heat-templates.git"
+                default: "${_param:jenkins_gerrit_url}/mk/heat-templates"
               HEAT_TEMPLATE_CREDENTIALS:
                 type: string
                 default: "gerrit"
@@ -65,7 +65,7 @@
                 default: "https://cloud-cz.bud.mirantis.net:5000"
               OPENSTACK_API_CREDENTIALS:
                 type: string
-                default: "openstack-qa-credentials"
+                default: "openstack-devcloud-credentials"
               OPENSTACK_API_PROJECT:
                 type: string
                 default: "mcp-mk"
diff --git a/jenkins/client/job/deploy/lab/mk/cloud.yml b/jenkins/client/job/deploy/lab/mk/cloud.yml
index 7461acf..5b15f35 100644
--- a/jenkins/client/job/deploy/lab/mk/cloud.yml
+++ b/jenkins/client/job/deploy/lab/mk/cloud.yml
@@ -9,6 +9,62 @@
         stack_type: aws
         stack_install: core,k8s,calico
         job_timer: "H H * * *"
+#      - stack_name: ceph_ha
+#        stack_type: heat
+#        stack_install: core
+#        job_timer: ""
+#      - stack_name: drivetrain_ha
+#        stack_type: heat
+#        stack_install: core
+#        job_timer: ""
+#      - stack_name: drivetrain_ha_clusters
+#        stack_type: heat
+#        stack_install: core
+#        job_timer: ""
+      - stack_name: k8s_aio_calico
+        stack_type: heat
+        stack_install: core,k8s,calico
+        job_timer: ""
+      - stack_name: k8s_aio_contrail
+        stack_type: heat
+        stack_install: core,k8s,contrail
+        job_timer: ""
+      - stack_name: k8s_ha_calico
+        stack_type: heat
+        stack_install: core,k8s,calico
+        job_timer: ""
+      - stack_name: k8s_ha_contrail
+        stack_type: heat
+        stack_install: core,k8s,contrail
+        job_timer: ""
+      - stack_name: os_aio_contrail
+        stack_type: heat
+        stack_install: core,openstack,contrail
+        job_timer: ""
+      - stack_name: os_aio_ovs
+        stack_type: heat
+        stack_install: core,openstack,ovs
+        job_timer: ""
+      - stack_name: os_ha_contrail
+        stack_type: heat
+        stack_install: core,openstack,contrail
+        job_timer: ""
+      - stack_name: os_ha_ovs
+        stack_type: heat
+        stack_install: core,openstack,ovs
+        job_timer: ""
+      - stack_name: stacklight_k8s_calico
+        stack_type: heat
+        stack_install: core,k8s,calico,stacklight
+        job_timer: ""
+      - stack_name: stacklight_os_contrail
+        stack_type: heat
+        stack_install: core,openstack,contrail,stacklight
+        job_timer: ""
+      - stack_name: stacklight_os_ovs
+        stack_type: heat
+        stack_install: core,openstack,ovs,stacklight
+        job_timer: ""
   jenkins:
     client:
       job_template:
@@ -83,6 +139,9 @@
               SALT_MASTER_URL:
                 type: string
                 default: ""
+              SALT_OVERRIDES:
+                type: text
+                default: ""
 
               # aws api
               AWS_STACK_REGION:
diff --git a/jenkins/client/job/deploy/lab/mk/virtual.yml b/jenkins/client/job/deploy/lab/mk/virtual.yml
index e615408..4e1fd97 100644
--- a/jenkins/client/job/deploy/lab/mk/virtual.yml
+++ b/jenkins/client/job/deploy/lab/mk/virtual.yml
@@ -92,3 +92,15 @@
         test: k8s
         timer: "H H(0-6) * * *"
         extra_formulas: ""
+      - lab: virtual_mcp11_contrail_nfv
+        install: core,openstack,contrail
+        stack_type: heat
+        test: openstack
+        timer: "H H(0-6) * * *"
+        extra_formulas: ""
+      - lab: virtual_mcp11_ovs_dpdk
+        install: core,openstack,ovs
+        stack_type: heat
+        test: openstack
+        timer: "H H(0-6) * * *"
+        extra_formulas: ""
diff --git a/jenkins/client/job/gating.yml b/jenkins/client/job/gating.yml
index 6b6d620..d0f2149 100644
--- a/jenkins/client/job/gating.yml
+++ b/jenkins/client/job/gating.yml
@@ -48,7 +48,6 @@
                   - failed
                   - unstable
                   - not_built
-                silent_start_mode: "true"
                 event:
                   comment:
                     - added:
diff --git a/jenkins/client/job/opencontrail/build/test.yml b/jenkins/client/job/opencontrail/build/test.yml
index efb09f9..655b9f8 100644
--- a/jenkins/client/job/opencontrail/build/test.yml
+++ b/jenkins/client/job/opencontrail/build/test.yml
@@ -64,7 +64,7 @@
                 event:
                  comment:
                     - addedContains:
-                        commentAddedCommentContains: '^(?s:Patch Set \d+:\s*(test|recheck|reverify)\s*)$'
+                        commentAddedCommentContains: '^(?s:Patch Set \d+:.*(test|recheck|reverify)\s*)$'
             param:
               TEST_MODELS:
                 type: string
diff --git a/jenkins/client/job/salt-formulas/tests.yml b/jenkins/client/job/salt-formulas/tests.yml
index 7fa88e1..eed632e 100644
--- a/jenkins/client/job/salt-formulas/tests.yml
+++ b/jenkins/client/job/salt-formulas/tests.yml
@@ -136,7 +136,7 @@
                 event:
                   comment:
                     - addedContains:
-                        commentAddedCommentContains: '^(?s:Patch Set \d+:\s*(test|recheck|reverify)\s*)$'
+                        commentAddedCommentContains: '^(?s:Patch Set \d+:.*(test|recheck|reverify)\s*)$'
             param:
               SALT_VERSION:
                 type: string
diff --git a/jenkins/client/job/salt-models/tests.yml b/jenkins/client/job/salt-models/tests.yml
index 89f5f0e..e59ae6a 100644
--- a/jenkins/client/job/salt-models/tests.yml
+++ b/jenkins/client/job/salt-models/tests.yml
@@ -24,7 +24,7 @@
                 event:
                   comment:
                     - addedContains:
-                        commentAddedCommentContains: '^(?s:Patch Set \d+:\s*(test|recheck|reverify)\s*)$'
+                        commentAddedCommentContains: '^(?s:Patch Set \d+:.*(test|recheck|reverify)\s*)$'
             param:
               SALT_OPTS:
                 type: string
@@ -49,6 +49,9 @@
               FORMULAS_SOURCE:
                 type: string
                 default: "{{formulas_src}}"
+              FORMULAS_REVISION:
+                type: string
+                default: "{{formulas_revision}}"
               SYSTEM_GIT_URL:
                 type: string
                 default: ""
@@ -109,7 +112,7 @@
                 event:
                   comment:
                     - addedContains:
-                        commentAddedCommentContains: '^(?s:Patch Set \d+:\s*(test|recheck|reverify)\s*)$'
+                        commentAddedCommentContains: '^(?s:Patch Set \d+:.*(test|recheck|reverify)\s*)$'
             param:
               COOKIECUTTER_TEMPLATE_URL:
                 type: string
@@ -165,7 +168,10 @@
               default: ""
             FORMULAS_SOURCE:
               type: string
-              default: "{{formulas_src}}"
+              default: "pkg"
+            FORMULAS_REVISION:
+              type: string
+              default: "stable"
             SYSTEM_GIT_URL:
               type: string
               default: ""
diff --git a/neutron/compute/cluster.yml b/neutron/compute/cluster.yml
index 64ba477..d6674f0 100644
--- a/neutron/compute/cluster.yml
+++ b/neutron/compute/cluster.yml
@@ -1,9 +1,9 @@
 classes:
 - service.neutron.compute.single
 parameters:
+  _param:
+    neutron_enable_qos: False
   neutron:
-    _param:
-      neutron_enable_qos: False
     compute:
       dvr: ${_param:neutron_compute_dvr}
       qos: ${_param:neutron_enable_qos}
@@ -15,4 +15,4 @@
         members:
           - host: ${_param:openstack_message_queue_node01_address}
           - host: ${_param:openstack_message_queue_node02_address}
-          - host: ${_param:openstack_message_queue_node03_address}
\ No newline at end of file
+          - host: ${_param:openstack_message_queue_node03_address}
diff --git a/neutron/gateway/cluster.yml b/neutron/gateway/cluster.yml
index 52462dd..a4f37b1 100644
--- a/neutron/gateway/cluster.yml
+++ b/neutron/gateway/cluster.yml
@@ -1,9 +1,9 @@
 classes:
 - service.neutron.gateway.single
 parameters:
+  _param:
+    neutron_enable_qos: False
   neutron:
-    _param:
-      neutron_enable_qos: False
     gateway:
       dvr: ${_param:neutron_gateway_dvr}
       qos: ${_param:neutron_enable_qos}
diff --git a/openssh/server/team/mcp_ci.yml b/openssh/server/team/mcp_ci.yml
index cd931a6..4bf0a5c 100644
--- a/openssh/server/team/mcp_ci.yml
+++ b/openssh/server/team/mcp_ci.yml
@@ -23,6 +23,13 @@
           full_name: Dmytro Kaiharodtsev
           home: /home/dkaiharodsev
           email: dkaiharodsev@mirantis.com
+        sotpuschennikov:
+          enabled: true
+          name: sotpuschennikov
+          sudo: true
+          full_name: Sergey Otpuschennikov
+          home: /home/sotpuschennikov
+          email: sotpuschennikov@mirantis.com
   openssh:
     server:
       enabled: true
@@ -42,6 +49,11 @@
           public_keys:
           - ${public_keys:dkaiharodsev}
           user: ${linux:system:user:dkaiharodsev}
+        sotpuschennikov:
+          enabled: true
+          public_keys:
+          - ${public_keys:sotpuschennikov}
+          user: ${linux:system:user:sotpuschennikov}
   public_keys:
     rkamaldinov:
       key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCzeIFxatNuXWuaTomcGDTMlpqiF6KlK47BSO5yIpfWHTL7o0OFsQArB4UeZ9AC7JHQg1bpxzscJxz8Xj3tA1f8yOCrepR8LbWh7L6a1hMhSCJPK9QLUHPCLV4PW0ghq46Um8ekxMbEqGM/rrKP+GeYxNFUxJMHCkKbZAsV+BV8amuJHQkYt29GP/hgYyZEoWKErqoQ/uGQ0qWEMVQsnus6M3p3c/v1J4JtbbrmRBjyrPx/Tjinw6K2sgocgBZT7vVb4PYwbONi1IAclkPJIyrSNEavZ4MbK93ZXNQCV7rkUbKmHT71Qle34/ks9zyERJ3RgB+pWgQqCjtmJeV51V1 rkamaldinov@mirantis.com
@@ -49,3 +61,5 @@
       key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPKldN0BL6C/pmjkKyaSUw9OTU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Dw/mh2DiHSiCQUPGZDo49MIw4WqEwqpQKcJGjD0Ihy2pjzwI9ZUzCNWe+bUcqDdl/9SH4YsNbfaK4Te6H pers@sotpuschennikov
diff --git a/prometheus/alertmanager/notification/pushkin.yml b/prometheus/alertmanager/notification/pushkin.yml
index 3d3332d..905a292 100644
--- a/prometheus/alertmanager/notification/pushkin.yml
+++ b/prometheus/alertmanager/notification/pushkin.yml
@@ -7,24 +7,16 @@
     alertmanager:
       config:
         route:
-          group_by: ['region', 'service']
-          group_wait: 60s
-          group_interval: 5m
-          repeat_interval: 3h
-          receiver: pushkin_notification
           routes:
-            - match:
-                route: email
-              receiver: email_notification
-            - match:
-                route: salesforce
-              receiver: salesforce_notification
-        receivers:
-          - name: salesforce_notification
+            pushkin:
+              receiver: HTTP-pushkin
+              match_re:
+                - label: route
+                  value:  .+?
+        receiver:
+          HTTP-pushkin:
+            enabled: true
             webhook_configs:
-              - url: "${_param:alertmanager_notification_pushkin_host}:${_param:alertmanager_notification_pushkin_port}/webhook?app=stacklight&route=salesforce&cluster_id=id"
-                send_resolved: true
-          - name: pushkin_notification
-            webhook_configs:
-              - url: "${_param:alertmanager_notification_pushkin_host}:${_param:alertmanager_notification_pushkin_port}/webhook?app=stacklight&route=email&cluster_id=id"
+              pushkin-vip:
+                url: "${_param:alertmanager_notification_pushkin_host}:${_param:alertmanager_notification_pushkin_port}/webhook?app=stacklight"
                 send_resolved: true
diff --git a/prometheus/exporters/jmx/init.yml b/prometheus/exporters/jmx/init.yml
new file mode 100644
index 0000000..4052201
--- /dev/null
+++ b/prometheus/exporters/jmx/init.yml
@@ -0,0 +1,2 @@
+classes:
+- service.prometheus.exporters.jmx
diff --git a/prometheus/exporters/libvirt/init.yml b/prometheus/exporters/libvirt/init.yml
new file mode 100644
index 0000000..5686f44
--- /dev/null
+++ b/prometheus/exporters/libvirt/init.yml
@@ -0,0 +1,2 @@
+classes:
+- service.prometheus.exporters.libvirt
diff --git a/telegraf/agent/input/http_listener.yml b/telegraf/agent/input/http_listener.yml
new file mode 100644
index 0000000..89720e4
--- /dev/null
+++ b/telegraf/agent/input/http_listener.yml
@@ -0,0 +1,13 @@
+parameters:
+  _param:
+    telegraf_agent_http_listener_port: 8186
+  telegraf:
+    agent:
+      input:
+        http_listener:
+          bind:
+            address: 127.0.0.1
+            port: ${_param:telegraf_agent_http_listener_port}
+          read_timeout: 10s
+          write_timeout: 10s
+          tagexclude: ['hostname']
diff --git a/telegraf/agent/output/prometheus.yml b/telegraf/agent/output/prometheus.yml
new file mode 100644
index 0000000..952bc13
--- /dev/null
+++ b/telegraf/agent/output/prometheus.yml
@@ -0,0 +1,11 @@
+parameters:
+  _param:
+    telegraf_agent_prometheus_port: 9126
+  telegraf:
+    agent:
+      output:
+        prometheus_client:
+          bind:
+            address: 0.0.0.0
+            port: ${_param: telegraf_agent_prometheus_port}
+          engine: prometheus
diff --git a/telegraf/agent/remote.yml b/telegraf/agent/remote/init.yml
similarity index 100%
rename from telegraf/agent/remote.yml
rename to telegraf/agent/remote/init.yml
diff --git a/telegraf/agent/remote/input/http_listener.yml b/telegraf/agent/remote/input/http_listener.yml
new file mode 100644
index 0000000..d6788d2
--- /dev/null
+++ b/telegraf/agent/remote/input/http_listener.yml
@@ -0,0 +1,13 @@
+parameters:
+  _param:
+    telegraf_remote_agent_http_listener_port: 8186
+  telegraf:
+    remote_agent:
+      input:
+        http_listener:
+          bind:
+            address: 0.0.0.0
+            port: ${_param:telegraf_remote_agent_http_listener_port}
+          read_timeout: 10s
+          write_timeout: 10s
+          tagexclude: ['hostname']
diff --git a/telegraf/agent/remote/output/prometheus.yml b/telegraf/agent/remote/output/prometheus.yml
new file mode 100644
index 0000000..8aadd96
--- /dev/null
+++ b/telegraf/agent/remote/output/prometheus.yml
@@ -0,0 +1,11 @@
+parameters:
+  _param:
+    telegraf_remote_agent_prometheus_port: 9126
+  telegraf:
+    remote_agent:
+      output:
+        prometheus_client:
+          bind:
+            address: 0.0.0.0
+            port: ${_param:telegraf_remote_agent_prometheus_port}
+          engine: prometheus