Fix OC4.0 addons manifest file

Change-Id: I449c8f774e3874b705f95862e337fbf3ca7ba4db
diff --git a/kubernetes/files/kube-addons/contrail/contrail.yaml b/kubernetes/files/kube-addons/contrail/contrail.yaml
index f023315..3387827 100644
--- a/kubernetes/files/kube-addons/contrail/contrail.yaml
+++ b/kubernetes/files/kube-addons/contrail/contrail.yaml
@@ -1,3 +1,6 @@
+{%- from "kubernetes/map.jinja" import common with context -%}
+---
+
 apiVersion: apps/v1beta2
 kind: DaemonSet
 metadata:
@@ -19,7 +22,7 @@
       hostNetwork: true
       containers:
       - name: rabbitmq
-        image: rabbitmq:3.6.6-management-alpine
+        image: rabbitmq:{{ common.addons.get('contrail',{}).get('rabbitmq_version',"3.6.6") }}-management-alpine
         lifecycle:
           postStart:
             exec:
@@ -41,17 +44,17 @@
                 rabbitmqctl set_policy ha-all "." '{"ha-mode":"exactly","ha-params":3,"ha-sync-mode":"automatic"}'
         env:
         - name: RABBITMQ_ERLANG_COOKIE
-          value: YTQMGYEHFATZPDKPOCXX
+          value: {{ common.addons.get('contrail',{}).get('rabbitmq_erlang_cookie',"YTQMGYEHFATZPDKPOCXX") }}
 
       - name: opencontrail-controller
-        image: docker-prod-local.artifactory.mirantis.com/opencontrail-oc40/opencontrail-controller
+        image: docker-prod-local.artifactory.mirantis.com/opencontrail-oc40/opencontrail-controller:{{ common.addons.get('contrail',{}).get('contrail_version',"latest") }}
         securityContext:
           privileged: true
         lifecycle:
           postStart:
             exec:
               command:
-              - /bin/sh
+              - /bin/shm
               - -c
               - >
                 service rabbitmq-server stop;
@@ -78,11 +81,10 @@
           mountPath: /etc/zookeeper/conf/zoo.cfg
         - name: etc-zookeeper-conf-log4j-properties
           mountPath: /etc/zookeeper/conf/log4j.properties
-        - name: var-lib-rabbitmq-erlang-cookie
-          mountPath: /var/lib/rabbitmq/.erlang.cookie
+
 
       - name: opencontrail-analyticsdb
-        image: docker-prod-local.artifactory.mirantis.com/opencontrail-oc40/opencontrail-analyticsdb
+        image: docker-prod-local.artifactory.mirantis.com/opencontrail-oc40/opencontrail-analyticsdb:{{ common.addons.get('contrail',{}).get('contrail_version',"latest") }}
         securityContext:
           privileged: true
         volumeMounts:
@@ -114,7 +116,7 @@
           mountPath: /etc/zookeeper/conf/log4j.properties
 
       - name: opencontrail-analytics
-        image: docker-prod-local.artifactory.mirantis.com/opencontrail-oc40/opencontrail-analytics
+        image: docker-prod-local.artifactory.mirantis.com/opencontrail-oc40/opencontrail-analytics:{{ common.addons.get('contrail',{}).get('contrail_version',"latest") }}
         volumeMounts:
         - name: etc-contrail
           mountPath: /etc/contrail
@@ -151,11 +153,6 @@
         hostPath:
           path: /etc/zookeeper/conf/zoo.cfg
           type: File
-      - name: var-lib-rabbitmq-erlang-cookie
-        hostPath:
-          path: /var/lib/rabbitmq/.erlang.cookie
-          type: File
-
 
       # analyticsdb
       - name: etc-cassandra-cassandra-env-analytics-sh
diff --git a/kubernetes/files/kube-addons/contrail/kube-manager.yaml b/kubernetes/files/kube-addons/contrail/kube-manager.yaml
index 7fd0e0e..3004649 100644
--- a/kubernetes/files/kube-addons/contrail/kube-manager.yaml
+++ b/kubernetes/files/kube-addons/contrail/kube-manager.yaml
@@ -1,3 +1,5 @@
+{%- from "kubernetes/map.jinja" import common with context -%}
+---
 apiVersion: apps/v1beta2
 kind: DaemonSet
 metadata:
@@ -19,7 +21,7 @@
       hostNetwork: true
       containers:
       - name: opencontrail-kube-manager
-        image: docker-prod-local.artifactory.mirantis.com/opencontrail-oc40/opencontrail-kube-manager
+        image: docker-prod-local.artifactory.mirantis.com/opencontrail-oc40/opencontrail-kube-manager:{{ common.addons.get('contrail',{}).get('contrail_version',"latest") }}
         securityContext:
           privileged: true
         lifecycle: