Merge "Revert Grafana Volume config"
diff --git a/aptly/server/mirror/debian/cassandra.yml b/aptly/server/mirror/debian/cassandra.yml
index 3d32e6a..846df4e 100644
--- a/aptly/server/mirror/debian/cassandra.yml
+++ b/aptly/server/mirror/debian/cassandra.yml
@@ -1,4 +1,6 @@
 parameters:
+  _param:
+    apt_mk_version: stable
   aptly:
     server:
       mirror:
@@ -14,5 +16,5 @@
           publisher:
             component: extra
             distributions:
-              - trusty/nightly
-              - xenial/nightly
+              - ubuntu-trusty/${_param:apt_mk_version}
+              - ubuntu-xenial/${_param:apt_mk_version}
diff --git a/aptly/server/mirror/debian/elasticsearch.yml b/aptly/server/mirror/debian/elasticsearch.yml
index 942b70a..ece60af 100644
--- a/aptly/server/mirror/debian/elasticsearch.yml
+++ b/aptly/server/mirror/debian/elasticsearch.yml
@@ -1,4 +1,6 @@
 parameters:
+  _param:
+    apt_mk_version: stable
   aptly:
     server:
       mirror:
@@ -12,8 +14,8 @@
           publisher:
             component: elastic
             distributions:
-              - trusty/nightly
-              - xenial/nightly
+              - trusty/${_param:apt_mk_version}
+              - xenial/${_param:apt_mk_version}
         kibana:
           source: http://packages.elasticsearch.org/kibana/4.4/debian
           distribution: stable
@@ -24,8 +26,8 @@
           publisher:
             component: elastic
             distributions:
-              - trusty/nightly
-              - xenial/nightly
+              - trusty/${_param:apt_mk_version}
+              - xenial/${_param:apt_mk_version}
         kibana-46:
           source: http://packages.elasticsearch.org/kibana/4.6/debian
           distribution: stable
@@ -36,8 +38,8 @@
           publisher:
             component: elastic
             distributions:
-              - trusty/nightly
-              - xenial/nightly
+              - trusty/${_param:apt_mk_version}
+              - xenial/${_param:apt_mk_version}
         elasticsearch-curator:
           source: http://packages.elastic.co/curator/4/debian
           distribution: stable
@@ -48,5 +50,5 @@
           publisher:
             component: elastic
             distributions:
-              - trusty/nightly
-              - xenial/nightly
+              - trusty/${_param:apt_mk_version}
+              - xenial/${_param:apt_mk_version}
diff --git a/aptly/server/mirror/ubuntu/trusty/mcp/apt_mk/init.yml b/aptly/server/mirror/ubuntu/trusty/mcp/apt_mk/init.yml
index 553e6dd..35ae854 100644
--- a/aptly/server/mirror/ubuntu/trusty/mcp/apt_mk/init.yml
+++ b/aptly/server/mirror/ubuntu/trusty/mcp/apt_mk/init.yml
@@ -41,18 +41,6 @@
             component: oc32
             distributions:
               - ubuntu-trusty/${_param:apt_mk_version}
-        mcp_opencontrail_trusty_oc303:
-          source: http://apt-mk.mirantis.com/trusty/
-          distribution: ${_param:apt_mk_version}
-          components: oc303
-          architectures: amd64
-          key_url: "http://apt-mk.mirantis.com/public.gpg"
-          gpgkeys:
-            - A76882D3
-          publisher:
-            component: oc303
-            distributions:
-              - ubuntu-trusty/${_param:apt_mk_version}
         mirantis_openstack_trusty_extra:
           source: http://apt-mk.mirantis.com/trusty/
           distribution: ${_param:apt_mk_version}
diff --git a/aptly/server/mirror/ubuntu/trusty/salt.yml b/aptly/server/mirror/ubuntu/trusty/salt.yml
index bfc4168..4c243b8 100644
--- a/aptly/server/mirror/ubuntu/trusty/salt.yml
+++ b/aptly/server/mirror/ubuntu/trusty/salt.yml
@@ -1,4 +1,6 @@
 parameters:
+  _param:
+    apt_mk_version: stable
   aptly:
     server:
       mirror:
@@ -12,5 +14,5 @@
           publisher:
             component: salt
             distributions:
-              - ubuntu-trusty/nightly
+              - ubuntu-trusty/${_param:apt_mk_version}
 
diff --git a/aptly/server/mirror/ubuntu/xenial/ceph_mirantis.yml b/aptly/server/mirror/ubuntu/xenial/ceph_mirantis.yml
index 3401a4e..eda0368 100644
--- a/aptly/server/mirror/ubuntu/xenial/ceph_mirantis.yml
+++ b/aptly/server/mirror/ubuntu/xenial/ceph_mirantis.yml
@@ -1,9 +1,11 @@
 parameters:
+  _param:
+    apt_mk_version: stable
   aptly:
     server:
       mirror:
         ubuntu-xenial-ceph-mirantis:
-          source: http://eu.mirror.fuel-infra.org/decapod/ceph/apt
+          source: http://eu.mirror.fuel-infra.org/decapod/ceph/jewel-xenial
           distribution: jewel-xenial
           components: main
           architectures: amd64
@@ -12,15 +14,4 @@
           publisher:
             component: ceph-mirantis
             distributions:
-              - ubuntu-xenial/nightly
-        ubuntu-xenial-decapod-ceph-mirantis:
-          source: http://eu.mirror.fuel-infra.org/decapod/ceph/apt
-          distribution: jewel-xenial
-          components: main
-          architectures: amd64
-          gpgkeys:
-            - 460F3994
-          publisher:
-            component: main
-            distributions:
-              - ubuntu-xenial-decapod-ceph/nightly
+              - ubuntu-xenial/${_param:apt_mk_version}
diff --git a/aptly/server/mirror/ubuntu/xenial/docker.yml b/aptly/server/mirror/ubuntu/xenial/docker.yml
index 819de76..4334374 100644
--- a/aptly/server/mirror/ubuntu/xenial/docker.yml
+++ b/aptly/server/mirror/ubuntu/xenial/docker.yml
@@ -1,4 +1,6 @@
 parameters:
+  _param:
+    apt_mk_version: stable
   aptly:
     server:
       mirror:
@@ -12,4 +14,4 @@
           publisher:
             component: docker
             distributions:
-              - ubuntu-xenial/nightly
+              - ubuntu-xenial/${_param:apt_mk_version}
diff --git a/aptly/server/mirror/ubuntu/xenial/glusterfs.yml b/aptly/server/mirror/ubuntu/xenial/glusterfs.yml
index f8177a0..248de32 100644
--- a/aptly/server/mirror/ubuntu/xenial/glusterfs.yml
+++ b/aptly/server/mirror/ubuntu/xenial/glusterfs.yml
@@ -1,5 +1,6 @@
 parameters:
   _param:
+    apt_mk_version: stable
     glusterfs_version: 3.8
   aptly:
     server:
@@ -14,4 +15,4 @@
           publisher:
             component: glusterfs
             distributions:
-              - ubuntu-xenial/nightly
+              - ubuntu-xenial/${_param:apt_mk_version}
diff --git a/aptly/server/mirror/ubuntu/xenial/grafana.yml b/aptly/server/mirror/ubuntu/xenial/grafana.yml
index 2db0586..8dbb6ea 100644
--- a/aptly/server/mirror/ubuntu/xenial/grafana.yml
+++ b/aptly/server/mirror/ubuntu/xenial/grafana.yml
@@ -1,4 +1,6 @@
 parameters:
+  _param:
+    apt_mk_version: stable
   aptly:
     server:
       mirror:
@@ -12,4 +14,4 @@
           publisher:
             component: grafana
             distributions:
-              - ubuntu-xenial/nightly
+              - ubuntu-xenial/${_param:apt_mk_version}
diff --git a/aptly/server/mirror/ubuntu/xenial/influxdb.yml b/aptly/server/mirror/ubuntu/xenial/influxdb.yml
index 87930b9..a2ac597 100644
--- a/aptly/server/mirror/ubuntu/xenial/influxdb.yml
+++ b/aptly/server/mirror/ubuntu/xenial/influxdb.yml
@@ -1,4 +1,6 @@
 parameters:
+  _param:
+    apt_mk_version: stable
   aptly:
     server:
       mirror:
@@ -12,4 +14,4 @@
           publisher:
             component: influxdb
             distributions:
-              - ubuntu-xenial/nightly
+              - ubuntu-xenial/${_param:apt_mk_version}
diff --git a/aptly/server/mirror/ubuntu/xenial/maas.yml b/aptly/server/mirror/ubuntu/xenial/maas.yml
index 1382a09..0e4a559 100644
--- a/aptly/server/mirror/ubuntu/xenial/maas.yml
+++ b/aptly/server/mirror/ubuntu/xenial/maas.yml
@@ -1,4 +1,6 @@
 parameters:
+  _param:
+    apt_mk_version: stable
   aptly:
     server:
       mirror:
@@ -12,4 +14,4 @@
           publisher:
             component: maas
             distributions:
-              - xenial/nightly
+              - xenial/${_param:apt_mk_version}
diff --git a/aptly/server/mirror/ubuntu/xenial/mcp/apt_mk/init.yml b/aptly/server/mirror/ubuntu/xenial/mcp/apt_mk/init.yml
index 6272b69..a340a46 100644
--- a/aptly/server/mirror/ubuntu/xenial/mcp/apt_mk/init.yml
+++ b/aptly/server/mirror/ubuntu/xenial/mcp/apt_mk/init.yml
@@ -41,18 +41,6 @@
             component: oc32
             distributions:
               - ubuntu-xenial/${_param:apt_mk_version}
-        mcp_opencontrail_xenial_oc303:
-          source: http://apt-mk.mirantis.com/xenial/
-          distribution: ${_param:apt_mk_version}
-          components: oc303
-          architectures: amd64
-          key_url: "http://apt-mk.mirantis.com/public.gpg"
-          gpgkeys:
-            - A76882D3
-          publisher:
-            component: oc303
-            distributions:
-              - ubuntu-xenial/${_param:apt_mk_version}
         mirantis_openstack_xenial_extra:
           source: http://apt-mk.mirantis.com/xenial/
           distribution: ${_param:apt_mk_version}
diff --git a/aptly/server/mirror/ubuntu/xenial/salt.yml b/aptly/server/mirror/ubuntu/xenial/salt.yml
index 9a9b34c..a100bde 100644
--- a/aptly/server/mirror/ubuntu/xenial/salt.yml
+++ b/aptly/server/mirror/ubuntu/xenial/salt.yml
@@ -1,4 +1,6 @@
 parameters:
+  _param:
+    apt_mk_version: stable
   aptly:
     server:
       mirror:
@@ -12,4 +14,4 @@
           publisher:
             component: salt
             distributions:
-              - ubuntu-xenial/nightly
+              - ubuntu-xenial/${_param:apt_mk_version}
diff --git a/designate/server/backend/pdns.yml b/designate/server/backend/pdns.yml
new file mode 100644
index 0000000..50ec3a2
--- /dev/null
+++ b/designate/server/backend/pdns.yml
@@ -0,0 +1,25 @@
+parameters:
+  designate:
+    server:
+      backend:
+        pdns4:
+          api_token: ${_param:designate_pdns_api_key}
+          api_endpoint: ${_param:designate_pdns_api_endpoint}
+  powerdns:
+    server:
+      enabled: true
+      bind:
+        address: ${_param:single_address}
+        port: 53
+      backend:
+        engine: sqlite
+        dbname: pdns.sqlite3
+        dbpath: /var/lib/powerdns
+      api:
+        enabled: true
+        key: ${_param:designate_pdns_api_key}
+      webserver:
+        enabled: true
+        address: ${_param:single_address}
+        port: ${_param:powerdns_webserver_port}
+        password: ${_param:powerdns_webserver_password}
diff --git a/elasticsearch/server/curator.yml b/elasticsearch/server/curator.yml
index 82f34bb..e4e5ace 100644
--- a/elasticsearch/server/curator.yml
+++ b/elasticsearch/server/curator.yml
@@ -30,3 +30,23 @@
               unit: days
               unit_count: ${_param:elasticsearch_curator_retention_period}
               exclude:
+          - action: delete_indices
+            description: >-
+                Delete indices older than ${_param:elasticsearch_curator_retention_period} days (based on index name).
+            options:
+              ignore_empty_list: True
+              timeout_override:
+              continue_if_exception: False
+              disable_action: False
+            filters:
+            - filtertype: pattern
+              kind: regex
+              value: "^events_.*$"
+              exclude:
+            - filtertype: age
+              source: name
+              direction: older
+              timestring: '%Y-%m-%d'
+              unit: days
+              unit_count: ${_param:elasticsearch_curator_retention_period}
+              exclude:
\ No newline at end of file
diff --git a/haproxy/proxy/listen/stacklight/redis.yml b/haproxy/proxy/listen/stacklight/redis.yml
index 881e8ed..7bc5ea6 100644
--- a/haproxy/proxy/listen/stacklight/redis.yml
+++ b/haproxy/proxy/listen/stacklight/redis.yml
@@ -5,6 +5,8 @@
         redis:
           mode: tcp
           check: False
+          options:
+          - tcp-check
           health-check:
             tcp:
               options:
diff --git a/jenkins/client/job/docker/build-images.yml b/jenkins/client/job/docker/build-images.yml
index e9e7447..ca1d058 100644
--- a/jenkins/client/job/docker/build-images.yml
+++ b/jenkins/client/job/docker/build-images.yml
@@ -6,7 +6,11 @@
           name: "docker-build-images-{{name}}"
           jobs:
             - name: aptly
+              repo: mk
             - name: ci
+              repo: mk
+            - name: prometheus
+              repo: mcp
           template:
             discard:
               build:
@@ -17,7 +21,7 @@
             concurrent: true
             scm:
               type: git
-              url: "${_param:jenkins_gerrit_url}/mk/docker-{{name}}"
+              url: "${_param:jenkins_gerrit_url}/{{repo}}/docker-{{name}}"
               credentials: "gerrit"
             trigger:
               gerrit:
@@ -31,7 +35,7 @@
             param:
               IMAGE_GIT_URL:
                 type: string
-                default: "${_param:jenkins_gerrit_url}/mk/docker-{{name}}"
+                default: "${_param:jenkins_gerrit_url}/{{repo}}/docker-{{name}}"
               IMAGE_BRANCH:
                 type: string
                 default: "master"
diff --git a/keystone/server/wsgi.yml b/keystone/server/wsgi.yml
index 2c8a19d..1a949e9 100644
--- a/keystone/server/wsgi.yml
+++ b/keystone/server/wsgi.yml
@@ -15,5 +15,10 @@
           name: wsgi
           host:
             name: ${linux:network:fqdn}
+          log:
+            custom:
+              format: >-
+                %v:%p %h %l %u %t \"%r\" %>s %D %O \"%{Referer}i\" \"%{User-Agent}i\"
+
       modules:
         - wsgi
diff --git a/linux/system/repo_local/ceph.yml b/linux/system/repo_local/ceph.yml
new file mode 100644
index 0000000..d28c0b6
--- /dev/null
+++ b/linux/system/repo_local/ceph.yml
@@ -0,0 +1,9 @@
+parameters:
+  linux:
+    system:
+      repo:
+        ceph:
+          refresh_db: ${_param:linux_repo_refresh_db}
+          source: "deb [arch=amd64] http://${_param:local_repo_url}/ubuntu-${_param:linux_system_codename}/ ${_param:apt_mk_version} ceph-mirantis"
+          architectures: amd64
+          key_url: "http://${_param:local_repo_url}/public.gpg"
diff --git a/linux/system/repo_local/docker.yml b/linux/system/repo_local/docker.yml
new file mode 100644
index 0000000..cd3b514
--- /dev/null
+++ b/linux/system/repo_local/docker.yml
@@ -0,0 +1,9 @@
+parameters:
+  linux:
+    system:
+      repo:
+        docker:
+          refresh_db: ${_param:linux_repo_refresh_db}
+          source: "deb [arch=amd64] http://${_param:local_repo_url}/ubuntu-${_param:linux_system_codename}/ ${_param:apt_mk_version} docker"
+          architectures: amd64
+          key_url: "http://${_param:local_repo_url}/public.gpg"
diff --git a/linux/system/repo_local/elasticsearch.yml b/linux/system/repo_local/elasticsearch.yml
new file mode 100644
index 0000000..8dc78aa
--- /dev/null
+++ b/linux/system/repo_local/elasticsearch.yml
@@ -0,0 +1,9 @@
+parameters:
+  linux:
+    system:
+      repo:
+        elasticsearch:
+          refresh_db: ${_param:linux_repo_refresh_db}
+          source: "deb [arch=amd64] http://${_param:local_repo_url}/${_param:linux_system_codename}/ ${_param:apt_mk_version} elastic"
+          architectures: amd64
+          key_url: "http://${_param:local_repo_url}/public.gpg"
diff --git a/linux/system/repo_local/grafana.yml b/linux/system/repo_local/grafana.yml
index a94d1be..f2d9ad5 100644
--- a/linux/system/repo_local/grafana.yml
+++ b/linux/system/repo_local/grafana.yml
@@ -4,6 +4,6 @@
       repo:
         grafana:
           refresh_db: ${_param:linux_repo_refresh_db}
-          source: "deb [arch=amd64] http://${_param:local_repo_url}/ubuntu-${_param:linux_system_codename}/ nightly grafana"
+          source: "deb [arch=amd64] http://${_param:local_repo_url}/ubuntu-${_param:linux_system_codename}/ ${_param:apt_mk_version} grafana"
           architectures: amd64
           key_url: "http://${_param:local_repo_url}/public.gpg"
diff --git a/linux/system/repo_local/influxdb.yml b/linux/system/repo_local/influxdb.yml
index 5e30d83..1c641bb 100644
--- a/linux/system/repo_local/influxdb.yml
+++ b/linux/system/repo_local/influxdb.yml
@@ -4,6 +4,6 @@
       repo:
         influxdb:
           refresh_db: ${_param:linux_repo_refresh_db}
-          source: "deb [arch=amd64] http://${_param:local_repo_url}/ubuntu-${_param:linux_system_codename}/ nightly influxdb"
+          source: "deb [arch=amd64] http://${_param:local_repo_url}/ubuntu-${_param:linux_system_codename}/ ${_param:apt_mk_version} influxdb"
           architectures: amd64
           key_url: "http://${_param:local_repo_url}/public.gpg"
diff --git a/opencontrail/client/resource/openstack_metadata.yml b/opencontrail/client/resource/openstack_metadata.yml
new file mode 100644
index 0000000..3ed8f3b
--- /dev/null
+++ b/opencontrail/client/resource/openstack_metadata.yml
@@ -0,0 +1,9 @@
+parameters:
+  opencontrail:
+    client:
+      linklocal_service:
+         metadata:
+           lls_ip: 169.254.169.254
+           lls_port: 80
+           ipf_addresses: ${_param:openstack_control_address}
+           ipf_port: 8775
diff --git a/opencontrail/compute/cluster4_0.yml b/opencontrail/compute/cluster4_0.yml
new file mode 100644
index 0000000..b21eb52
--- /dev/null
+++ b/opencontrail/compute/cluster4_0.yml
@@ -0,0 +1,46 @@
+applications:
+- opencontrail
+parameters:
+  _param:
+    opencontrail_compute_iface_mask: 24
+    opencontrail_version: 4.0
+    linux_repo_contrail_component: oc40
+  opencontrail:
+    common:
+      version: ${_param:opencontrail_version}
+      identity:
+        engine: keystone
+        host: ${_param:openstack_control_address}
+        port: 35357
+        token: ${_param:keystone_service_token}
+        password: ${_param:keystone_admin_password}
+      network:
+        engine: neutron
+        host: ${_param:openstack_control_address}
+        port: 9696
+    compute:
+      version: ${_param:opencontrail_version}
+      disable_flow_collection: true
+      enabled: True
+      bind:
+        address: ${_param:single_address}
+      config:
+        members:
+        - host: ${_param:opencontrail_control_node01_address}
+        - host: ${_param:opencontrail_control_node02_address}
+        - host: ${_param:opencontrail_control_node03_address}
+      collector:
+        members:
+        - host: ${_param:opencontrail_analytics_node01_address}
+        - host: ${_param:opencontrail_analytics_node02_address}
+        - host: ${_param:opencontrail_analytics_node03_address}
+      interface:
+        address: ${_param:opencontrail_compute_address}
+        dev: ${_param:opencontrail_compute_iface}
+        gateway: ${_param:opencontrail_compute_gateway}
+        mask: ${_param:opencontrail_compute_iface_mask}
+        dns: ${_param:opencontrail_compute_dns}
+        mtu: 9000
+  nova:
+    compute:
+      networking: contrail
diff --git a/opencontrail/compute/single4_0.yml b/opencontrail/compute/single4_0.yml
new file mode 100644
index 0000000..bd77c05
--- /dev/null
+++ b/opencontrail/compute/single4_0.yml
@@ -0,0 +1,44 @@
+applications:
+- opencontrail
+parameters:
+  _param:
+    opencontrail_compute_iface_mask: 24
+    opencontrail_version: 4.0
+    linux_repo_contrail_component: oc40
+  opencontrail:
+    common:
+      version: ${_param:opencontrail_version}
+      identity:
+        engine: keystone
+        host: ${_param:control_address}
+        port: 35357
+        token: ${_param:keystone_service_token}
+        password: ${_param:keystone_admin_password}
+      network:
+        engine: neutron
+        host: ${_param:control_address}
+        port: 9696
+    compute:
+      version: ${_param:opencontrail_version}
+      enabled: True
+      config:
+        members:
+        - host: ${_param:opencontrail_control_node01_address}
+        - host: ${_param:opencontrail_control_node02_address}
+        - host: ${_param:opencontrail_control_node03_address}
+      collector:
+        members:
+        - host: ${_param:opencontrail_analytics_node01_address}
+        - host: ${_param:opencontrail_analytics_node02_address}
+        - host: ${_param:opencontrail_analytics_node03_address}
+      interface:
+        address: ${_param:opencontrail_compute_address}
+        dev: ${_param:opencontrail_compute_iface}
+        gateway: ${_param:opencontrail_compute_gateway}
+        mask: ${_param:opencontrail_compute_iface_mask}
+        dns: ${_param:opencontrail_compute_dns}
+        mtu: 9000
+  nova:
+    compute:
+      networking: contrail
+
diff --git a/opencontrail/control/analytics4_0.yml b/opencontrail/control/analytics4_0.yml
new file mode 100644
index 0000000..1984ee5
--- /dev/null
+++ b/opencontrail/control/analytics4_0.yml
@@ -0,0 +1,60 @@
+classes:
+- service.haproxy.proxy.single
+- service.keepalived.cluster.single
+- service.opencontrail.control.analytics
+- system.haproxy.proxy.listen.opencontrail.analytics
+parameters:
+  _param:
+    opencontrail_version: 4.0
+    linux_repo_contrail_component: oc40
+# Temprorary fix for MOS9 packages to pin old version of kafka
+  linux:
+    system:
+      package:
+        librdkafka1:
+          version: 0.9.0-0contrail0
+          hold: true
+        python-kafka:
+          version: 1.0.1-0contrail1
+          hold: true
+      kernel:
+        modules:
+        - nf_conntrack_ipv4
+  opencontrail:
+    common:
+      identity:
+        host: ${_param:openstack_control_address}
+      network:
+        host: ${_param:openstack_control_address}
+    collector:
+      discovery:
+        host: None
+      database:
+        members:
+        - host: ${_param:opencontrail_analytics_node01_address}
+        - host: ${_param:opencontrail_analytics_node02_address}
+        - host: ${_param:opencontrail_analytics_node03_address}
+      analytics:
+        members:
+        - host: ${_param:opencontrail_analytics_node01_address}
+        - host: ${_param:opencontrail_analytics_node02_address}
+        - host: ${_param:opencontrail_analytics_node03_address}
+      message_queue:
+        host: ${_param:openstack_control_address}
+        members:
+        - host: ${_param:openstack_control_node01_address}
+        - host: ${_param:openstack_control_node02_address}
+        - host: ${_param:openstack_control_node03_address}
+      config:
+        members:
+        - host: ${_param:opencontrail_control_node01_address}
+        - host: ${_param:opencontrail_control_node02_address}
+        - host: ${_param:opencontrail_control_node03_address}
+    database:
+      discovery:
+        host: None
+      analytics:
+        members:
+        - host: ${_param:opencontrail_analytics_node01_address}
+        - host: ${_param:opencontrail_analytics_node02_address}
+        - host: ${_param:opencontrail_analytics_node03_address}
diff --git a/opencontrail/control/cluster4_0.yml b/opencontrail/control/cluster4_0.yml
new file mode 100644
index 0000000..5324fac
--- /dev/null
+++ b/opencontrail/control/cluster4_0.yml
@@ -0,0 +1,108 @@
+classes:
+- service.haproxy.proxy.single
+- service.keepalived.cluster.single
+- service.opencontrail.control.cluster
+- system.haproxy.proxy.listen.opencontrail.control
+- system.haproxy.proxy.listen.opencontrail.analytics
+parameters:
+  _param:
+    opencontrail_version: 4.0
+    linux_repo_contrail_component: oc40
+# Temprorary fix for MOS9 packages to pin old version of kafka
+  linux:
+    system:
+      package:
+        librdkafka1:
+          version: 0.9.0-0contrail0
+        python-kafka:
+          version: 1.0.1-0contrail1
+      kernel:
+        modules:
+        - nf_conntrack_ipv4
+  opencontrail:
+    common:
+      identity:
+        host: ${_param:openstack_control_address}
+      network:
+        host: ${_param:openstack_control_address}
+    collector:
+      discovery:
+        host: None
+      database:
+        members:
+        - host: ${_param:cluster_node01_address}
+        - host: ${_param:cluster_node02_address}
+        - host: ${_param:cluster_node03_address}
+      analytics:
+        members:
+        - host: ${_param:cluster_node01_address}
+        - host: ${_param:cluster_node02_address}
+        - host: ${_param:cluster_node03_address}
+      message_queue:
+        host: ${_param:openstack_control_address}
+        members:
+        - host: ${_param:openstack_control_node01_address}
+        - host: ${_param:openstack_control_node02_address}
+        - host: ${_param:openstack_control_node03_address}
+      config:
+        members:
+        - host: ${_param:cluster_node01_address}
+        - host: ${_param:cluster_node02_address}
+        - host: ${_param:cluster_node03_address}
+    database:
+      discovery:
+        host: None
+      analytics:
+        members:
+        - host: ${_param:cluster_node01_address}
+        - host: ${_param:cluster_node02_address}
+        - host: ${_param:cluster_node03_address}
+    config:
+      network:
+        host: ${_param:openstack_control_address}
+      bind:
+        address: ${_param:cluster_local_address}
+      discovery:
+        host: None
+      analytics:
+        members:
+        - host: ${_param:cluster_node01_address}
+        - host: ${_param:cluster_node02_address}
+        - host: ${_param:cluster_node03_address}
+      message_queue:
+        members:
+        - host: ${_param:openstack_message_queue_node01_address}
+        - host: ${_param:openstack_message_queue_node02_address}
+        - host: ${_param:openstack_message_queue_node03_address}
+      identity:
+        region: ${_param:openstack_region}
+        host: ${_param:openstack_control_address}
+    control:
+      analytics:
+        members:
+        - host: ${_param:cluster_node01_address}
+        - host: ${_param:cluster_node02_address}
+        - host: ${_param:cluster_node03_address}
+      message_queue:
+        members:
+        - host: ${_param:openstack_message_queue_node01_address}
+        - host: ${_param:openstack_message_queue_node02_address}
+        - host: ${_param:openstack_message_queue_node03_address}
+      database:
+        members:
+        - host: ${_param:cluster_node01_address}
+        - host: ${_param:cluster_node02_address}
+        - host: ${_param:cluster_node03_address}
+      discovery:
+        host: None
+    web:
+      analytics:
+        host: ${_param:opencontrail_control_address}
+      cache:
+        host: 127.0.0.1
+      identity:
+        host: ${_param:openstack_control_address}
+      database:
+        port: 9042
+      network:
+        host: ${_param:openstack_control_address}
diff --git a/opencontrail/control/control4_0.yml b/opencontrail/control/control4_0.yml
new file mode 100644
index 0000000..ae03dea
--- /dev/null
+++ b/opencontrail/control/control4_0.yml
@@ -0,0 +1,74 @@
+classes:
+- service.keepalived.cluster.single
+- service.opencontrail.control.control
+- system.haproxy.proxy.listen.opencontrail.control
+parameters:
+  _param:
+    opencontrail_version: 4.0
+    linux_repo_contrail_component: oc40
+  opencontrail:
+    common:
+      identity:
+        host: ${_param:openstack_control_address}
+      network:
+        host: ${_param:openstack_control_address}
+    config:
+      network:
+        host: ${_param:openstack_control_address}
+      bind:
+        address: ${_param:cluster_local_address}
+      discovery:
+        host: None
+      analytics:
+        members:
+        - host: ${_param:opencontrail_analytics_node01_address}
+        - host: ${_param:opencontrail_analytics_node02_address}
+        - host: ${_param:opencontrail_analytics_node03_address}
+      message_queue:
+        members:
+        - host: ${_param:openstack_message_queue_node01_address}
+        - host: ${_param:openstack_message_queue_node02_address}
+        - host: ${_param:openstack_message_queue_node03_address}
+      identity:
+        region: ${_param:openstack_region}
+        host: ${_param:openstack_control_address}
+    control:
+      analytics:
+        members:
+        - host: ${_param:opencontrail_analytics_node01_address}
+        - host: ${_param:opencontrail_analytics_node02_address}
+        - host: ${_param:opencontrail_analytics_node03_address}
+      message_queue:
+        members:
+        - host: ${_param:openstack_message_queue_node01_address}
+        - host: ${_param:openstack_message_queue_node02_address}
+        - host: ${_param:openstack_message_queue_node03_address}
+      database:
+        members:
+        - host: ${_param:opencontrail_control_node01_address}
+        - host: ${_param:opencontrail_control_node02_address}
+        - host: ${_param:opencontrail_control_node03_address}
+      discovery:
+        host: None
+    web:
+      analytics:
+        host: ${_param:opencontrail_analytics_address}
+      cache:
+        host: 127.0.0.1
+      identity:
+        host: ${_param:openstack_control_address}
+      database:
+        port: 9042
+      network:
+        host: ${_param:openstack_control_address}
+    database:
+      analytics:
+        members:
+        - host: ${_param:opencontrail_analytics_node01_address}
+        - host: ${_param:opencontrail_analytics_node02_address}
+        - host: ${_param:opencontrail_analytics_node03_address}
+  linux:
+    system:
+      kernel:
+        modules:
+        - nf_conntrack_ipv4
diff --git a/opencontrail/control/single4_0.yml b/opencontrail/control/single4_0.yml
new file mode 100644
index 0000000..cbd6520
--- /dev/null
+++ b/opencontrail/control/single4_0.yml
@@ -0,0 +1,138 @@
+classes:
+- service.opencontrail.control.single
+- service.haproxy.proxy.single
+parameters:
+  _param:
+    opencontrail_version: 4.0
+    linux_repo_contrail_component: oc40
+# Temprorary fix for MOS9 packages to pin old version of kafka
+  linux:
+    system:
+      package:
+        librdkafka1:
+          version: 0.9.0-0contrail0
+        python-kafka:
+          version: 1.0.1-0contrail1
+        contrail-api-cli:
+          version: latest
+      kernel:
+        modules:
+        - nf_conntrack_ipv4
+  haproxy:
+    proxy:
+      listen:
+        contrail_api:
+          type: contrail-api
+          service_name: contrail
+          check: false
+          binds:
+          - address: ${_param:single_address}
+            port: 8082
+          servers:
+          - name: ctl01
+            host: ${_param:single_address}
+            port: 9100
+            params: check inter 2000 rise 2 fall 3
+        contrail_discovery:
+          type: contrail-api
+          service_name: contrail
+          binds:
+          - address: ${_param:single_address}
+            port: 5998
+          servers:
+          - name: ctl01
+            host: ${_param:single_address}
+            port: 9110
+            params: check inter 2000 rise 2 fall 3
+        contrail_config_stats:
+          type: contrail-config
+          service_name: contrail
+          format: listen
+          binds:
+          - address: '*'
+            port: 5937
+          user: haproxy
+          password: ${_param:opencontrail_stats_password}
+        contrail_openstack_stats:
+          type: contrail-config
+          service_name: contrail
+          format: listen
+          binds:
+          - address: '*'
+            port: 5936
+          user: haproxy
+          password: ${_param:opencontrail_stats_password}
+        contrail_collector_stats:
+          type: contrail-config
+          service_name: contrail
+          format: listen
+          binds:
+          - address: '*'
+            port: 5938
+          user: haproxy
+          password: ${_param:opencontrail_stats_password}
+  opencontrail:
+    common:
+      identity:
+        host: ${_param:openstack_control_address}
+      network:
+        host: ${_param:openstack_control_address}
+    config:
+      network:
+        host: ${_param:openstack_control_address}
+      bind:
+        address: ${_param:single_address}
+      discovery:
+        host: None
+      analytics:
+        members:
+        - host: ${_param:single_address}
+      message_queue:
+        members:
+        - host: ${_param:openstack_control_address}
+      identity:
+        region: ${_param:openstack_region}
+        host: ${_param:openstack_control_address}
+    control:
+      analytics:
+        members:
+        - host: ${_param:single_address}
+      message_queue:
+        members:
+        - host: ${_param:openstack_control_address}
+      database:
+        members:
+        - host: ${_param:single_address}
+      discovery:
+        host: None
+    web:
+      analytics:
+        host: ${_param:single_address}
+      cache:
+        host: 127.0.0.1
+      identity:
+        host: ${_param:openstack_control_address}
+      database:
+        port: 9042
+      network:
+        host: ${_param:openstack_control_address}
+    database:
+      analytics:
+        members:
+        - host: ${_param:single_address}
+    collector:
+      discovery:
+        host: None
+      database:
+        members:
+        - host: ${_param:single_address}
+      analytics:
+        members:
+        - host: ${_param:single_address}
+      message_queue:
+        host: ${_param:openstack_control_address}
+        members:
+        - host: ${_param:openstack_control_address}
+      config:
+        members:
+        - host: ${_param:single_address}
diff --git a/openssh/server/team/stacklight.yml b/openssh/server/team/stacklight.yml
index 46ba395..3fb5913 100644
--- a/openssh/server/team/stacklight.yml
+++ b/openssh/server/team/stacklight.yml
@@ -16,13 +16,6 @@
           full_name: Simon Pasquier
           home: /home/spasquier
           email: spasquier@mirantis.com
-        scroiset:
-          enabled: true
-          name: scroiset
-          sudo: true
-          full_name: Swann Croiset
-          home: /home/scroiset
-          email: scroiset@mirantis.com
         ppetit:
           enabled: true
           name: ppetit
@@ -65,13 +58,6 @@
           full_name: Martin Polreich
           home: /home/mpolreich
           email: mpolreich@mirantis.com
-        ityaptin:
-          enabled: true
-          name: ityaptin
-          sudo: true
-          full_name: Ilya Tyaptin
-          home: /home/ityaptin
-          email: ityaptin@mirantis.com
         isvetlov:
           enabled: true
           name: isvetlov
@@ -116,11 +102,6 @@
           public_keys:
           - ${public_keys:spasquier}
           user: ${linux:system:user:spasquier}
-        scroiset:
-          enabled: true
-          public_keys:
-          - ${public_keys:scroiset}
-          user: ${linux:system:user:scroiset}
         ppetit:
           enabled: true
           public_keys:
@@ -151,11 +132,6 @@
           public_keys:
           - ${public_keys:mpolreich}
           user: ${linux:system:user:mpolreich}
-        ityaptin:
-          enable: true
-          public_keys:
-          - ${public_keys:ityaptin}
-          user: ${linux:system:user:ityaptin}
         isvetlov:
           enable: true
           public_keys:
@@ -181,8 +157,6 @@
       key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3odU+3V2uDA2ptAFL9hrJRPNEEdAyztWOZFQ5Oyd9oerTGOU3p4xmrgWWjfKFKbYGhiiIUcYAol5PkTfKukGEkkjCHYA1t023soCaaAj85wCZCnw2zQNAziwxTYmAzTqgxiSvtZNMMrtJvFHRIRDzJ3M1lV0prWNWkMM1/3FAd4W49y6VT3fkMCo8uqG7CfGdgR2DgBCxf9KaNPfW5eDEPOgmE5lK8tVSEI6T+Cg7hbcTf4lFYnlFBnlQgp/0JstsM4Vbwb4B34LOpOsf2S8rrWk2xQMjwaMHXkc2s/E8iW3F5nVFuyEXYISFQIiAHw8dzC6CHgLcyHUVWwznKawZ newt@newt-dev1
     spasquier:
       key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCXBHKQaGUNB92DsnyvflmCbmuXnkiuNahZiue3hnyXqLA2q8jmQmzBbxReAJzexnVfJhrUCTw8IPJUpMUP27u3igvGdkhfctdUuxVf9yGJErtGNgHK/aGbeLCvUOmhw6X/xbf3IbyFL1gwxOJ2cmmjlSptYU9E1W2xFY+IMFWBhzO3vso5EABgPVli/UUMfeXUUd++lIZpoyYe2Hkri1QGNhzfbZcFjEO78+vNiLZrvjJEtkXWu7iZTYK6eE365CiFJzqFL7N6Ichb28qakcmVqR/foreuz3cOMqMGssKoOQk1213x8w4fE0yLwf9Ft8L7GMf+vXQvuNt0ZKBPWqn7 spasquier@mirantis.com
-    scroiset:
-      key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDUfVxx6qi4fay4znw8M6yLJJcRr3pdvPPihTAszioFJP9V/GBbqfkofTfeKdpdvJ4j25p40boiDt43Ek7LfcRmKMP9+2SEfk9W7ec/umM8Mer+h4ocnShVQm69weELVUfr9q4G+qWf14ANc9D097bclqQ6FP/cjy8HodVPgQ+i1lpMjwP6xvAAERJJH353lCFsxkh2N8aOi9YcP9M2lQeKWM+eYFsdcmTFAPHbgPq0K4ma6/YXw5UibEBClYu1u4OJTFZSI3z8kERb2cU0aFGYAduiynDMBKM7y7YAoksgBOVprq0huEMFUqJ3vsrZbPn55GIpzmBga+EGnNbSCadt swann@scroiset
     ppetit:
       key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCUGCb+mGidT4FRa4rJxoYx39NX2vCjRw+CmCQJW/Uf6xc0NNp5WRWJ0hnyIMRVVfehvfjdXPo4bO4cXIwmo06C1Wx+DMyvjI9NvuHtt52p3QTsh+PYZe5t4hFuGh7veWQw3LuLtDLVlVS633FQMgT/BXDaBc65yfN9CuV6lHqZ6KPKoGAi3ADlcQFqhFttO+GsVkxd6uGtelnbYXsDMwylCIKop0C/obu6wG85d/8Q2/Zts5CvUcCiCNfZtl8otgNMrpfnuhC0xAsmgwDxqK2kshxUujclyFfO7ixl+E9Plc7kUJvodNbzOcAmY3YpuHVoJQkHx/Ou81/q+JOVtFxz ppetit@baobab 
     obourdon:
@@ -195,8 +169,6 @@
       key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrCyaZjs8hiwx38LfpeQ2z9n9ptwQ7gFrhq2z5sK9q/LQMCubbnp5xhyF0SMY1jmQUewBOKXhnq3QSX+DmtNsnhitnZBw2BE5PBXllCBWMMiWULfAYvB0of728Q3EEjrtyfHkt7o2E+CvreVJcVI4kBwjKh5WpVBZ8mmkW/sexLGMuYu0bUWjCddu6ZlhUa+y14VZKOKp44auemza1VL/UzqOVZkBAfR2gPV2pBG3Im+SlnOlDRxKPEXQbsn3u/sNeZq0wSY++khY86AU7jAKfL2NiNsoA7CyB0jTEKwYO3vOWOhECifZuHwY/TNWyRFWM2ImW3mT9aO7nE4w4jXXJ vgusev@vgusev
     mpolreich:
       key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC0N+ds8BGTR+ZQo9NSRGRbjv3T8AbPmtSw2nClXxetRdmHpM/mU7/5iD7qfkCXtNptKeCG/Qk44wlijnAtjztJK1qfvyphHe3etZxLnqhYMm73Yy++yKPE/ywFPFb+7kd0BDy2iZqohZpX3gUi5iDnvXUInHNqqtTv3xFe2kmn3lq5bSRuUMtr61nZ7z/fkX8kNfoGxKrm7bhSo5zq4sjTrj3lk1LKZc1HYji3RwrzBM0z4eyed1BaJyDNtG+eFN4nOnvVn59452AR8SmKJXRErk37rEoQn80xszypzybooFPN5dpdB6u9b4xquFCOD83usb8kEjKY9VIYGuXxEEts1KIF20J+xd8UnZU8d4JL50G8JY8zdNgurR3ZyMD2okuord4cpHF8SVecsAyRV6nuhDxVtF2Xn/RriY02jrLoRPsS+3nIrKt9H8vpQZMYJ+jgEpekZhhVfz4AP3pATzOrWENzNXj5G1bLJs1C9aTtwE27EnKW73XekX/GLsehCwsQ21JvDX8PMxJwLVfqvkRlrc5GILEIVgjZ82Cj6Eens1QobymRAEWuEpZxkPx6u0kGO62ri8zFx8+NYwYDz3mwhHDRT34T/Rvzy/9V9xVjkUQOj9cZ3eYBnC1MffJjx8heHDmSQmUd+99zKa9Hzr74z3AvR3AIgFqmu7kx5fIMew== ubuntu@thinkpad-x1
-    ityaptin:
-      key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDLTkl8X9HIJxruAHkmGNQTovy7DCr256pH68xh2DHWinPKUW4ccsCBbqJeF56aEA41OKJlEVOYzD3gQJkDAAbDdy9BlI14oEtzmk3yAtgBwwUzUNMq7oCPrbt4xNg5U26JSb26j69r5vQ4vXA2hf0bCQ68vb3VDqMMaMbneI3rP3qSaq7dauR8sEjx1XAtNen5SygLE46k0pCObJmahGkg39HisoJ/gkjoi/xvQn1JzrYSxWObrBfUbtQN3JbCRozSp/0Env0hMbXj7cS3J/uY68zAWc7GAEFKSmPAol4d/93sRknFUSQKqZjsDaLfiGLte/7oFwLquaz6AJw+mwP ityaptin@ityaptin.local
     isvetlov:
       key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9lvegjKq6OP7cgF9YU9mPOk1/mfJbov3YnYnhiW1Ks0hrWZyAo+0TV3O7LgWZ8jqD9abbYaOiWCt4d9ABkLUJfCLNAqOJRapJ+tybPAxJKx4eV8pptJ7UF0EdItasTdd+gqJJ4Krk869rwmqVQ4hethdykjhKyWu3bG+uVtFUF5xUj9zaT9NThA6/Xhz0idAiTO8ArmLng4W8ne45gANaHIWXpIsklo6GLUSZwl4z6j2z4joxNJsB1hrw0msT56F26ctkDo6thNMAzPMyZsLjYJBJIRYhdC1d4Up9114nVcY4pzYw76+zXU9zED2XNRLdyAaxFlwXvumAs3iMLI8Z isvetlov@isvetlov-mac.local
     akholkin:
diff --git a/reclass/storage/system/stacklight_log_cluster.yml b/reclass/storage/system/stacklight_log_cluster.yml
index 4a5da29..bbb6a6b 100644
--- a/reclass/storage/system/stacklight_log_cluster.yml
+++ b/reclass/storage/system/stacklight_log_cluster.yml
@@ -22,6 +22,7 @@
           domain: ${_param:cluster_domain}
           classes:
           - cluster.${_param:cluster_name}.stacklight.log
+          - cluster.${_param:cluster_name}.stacklight.log_curator
           params:
             salt_master_host: ${_param:reclass_config_master}
             linux_system_codename: xenial
@@ -32,6 +33,7 @@
           domain: ${_param:cluster_domain}
           classes:
           - cluster.${_param:cluster_name}.stacklight.log
+          - cluster.${_param:cluster_name}.stacklight.log_curator
           params:
             salt_master_host: ${_param:reclass_config_master}
             linux_system_codename: xenial