Use variables for kafka config/log dirs as they can be different,
starting from OC 4.1

Change-Id: Ib1de79627ae889794b63d778b5cc861f43972198
Related-PROD: PROD-25533
diff --git a/opencontrail/control/analytics.yml b/opencontrail/control/analytics.yml
index 7471997..d6cff61 100644
--- a/opencontrail/control/analytics.yml
+++ b/opencontrail/control/analytics.yml
@@ -6,7 +6,7 @@
 parameters:
   _param:
     opencontrail_kafka_log_cleanup_mtime: '+7'
-    opencontrail_kafka_log_cleanup_dir: '/usr/share/kafka/logs/'
+    opencontrail_kafka_log_dir: '/usr/share/kafka/logs'
 # Temprorary fix for MOS9 packages to pin old version of kafka
   linux:
     system:
@@ -22,7 +22,7 @@
         - nf_conntrack_ipv4
       job:
         kafka_logs_cleanup:
-          command: "find ${_param:opencontrail_kafka_log_cleanup_dir} -name '*.log.*' -type f -mtime ${_param:opencontrail_kafka_log_cleanup_mtime} -exec rm {} \\;"
+          command: "find ${_param:opencontrail_kafka_log_dir} -name '*.log.*' -type f -mtime ${_param:opencontrail_kafka_log_cleanup_mtime} -exec rm {} \\;"
           identifier: kafka_logs_cleanup
           hour: 0
           minute: 0
diff --git a/opencontrail/control/analytics4_0.yml b/opencontrail/control/analytics4_0.yml
index f0cf352..ed6fb15 100644
--- a/opencontrail/control/analytics4_0.yml
+++ b/opencontrail/control/analytics4_0.yml
@@ -6,8 +6,9 @@
 - system.haproxy.proxy.listen.opencontrail.analytics
 parameters:
   _param:
+    opencontrail_kafka_config_dir: '/usr/share/kafka/config'
     opencontrail_kafka_log_cleanup_mtime: '+7'
-    opencontrail_kafka_log_cleanup_dir: '/usr/share/kafka/logs/'
+    opencontrail_kafka_log_dir: '/usr/share/kafka/logs'
     opencontrail_version: 4.0
     linux_repo_contrail_component: oc40
     opencontrail_image_tag: latest
@@ -27,7 +28,7 @@
         - nf_conntrack_ipv4
       job:
         kafka_logs_cleanup:
-          command: "find ${_param:opencontrail_kafka_log_cleanup_dir} -name '*.log.*' -type f -mtime ${_param:opencontrail_kafka_log_cleanup_mtime} -exec rm {} \\;"
+          command: "find ${_param:opencontrail_kafka_log_dir} -name '*.log.*' -type f -mtime ${_param:opencontrail_kafka_log_cleanup_mtime} -exec rm {} \\;"
           identifier: kafka_logs_cleanup
           hour: 0
           minute: 0
@@ -101,10 +102,10 @@
                 - /var/lib/analyticsdb:/var/lib/cassandra
                 - /var/lib/analyticsdb_zookeeper_data:/var/lib/zookeeper
                 - /var/lib/zookeeper/myid:/var/lib/zookeeper/myid
-                - /usr/share/kafka/config/server.properties:/usr/share/kafka/config/server.properties
-                - /usr/share/kafka/config/consumer.properties:/usr/share/kafka/config/consumer.properties
-                - /usr/share/kafka/config/zookeeper.properties:/usr/share/kafka/config/zookeeper.properties
-                - /usr/share/kafka/logs:/usr/share/kafka/logs
+                - ${_param:opencontrail_kafka_config_dir}/server.properties:${_param:opencontrail_kafka_config_dir}/server.properties
+                - ${_param:opencontrail_kafka_config_dir}/consumer.properties:${_param:opencontrail_kafka_config_dir}/consumer.properties
+                - ${_param:opencontrail_kafka_config_dir}/zookeeper.properties:${_param:opencontrail_kafka_config_dir}/zookeeper.properties
+                - ${_param:opencontrail_kafka_log_dir}:${_param:opencontrail_kafka_log_dir}
                 - /etc/zookeeper/conf/zoo_analytics.cfg:/etc/zookeeper/conf/zoo.cfg
                 - /etc/zookeeper/conf/log4j.properties:/etc/zookeeper/conf/log4j.properties
                 - /var/log/contrail:/var/log/contrail
diff --git a/opencontrail/control/cluster.yml b/opencontrail/control/cluster.yml
index 28c12c4..33bfedc 100644
--- a/opencontrail/control/cluster.yml
+++ b/opencontrail/control/cluster.yml
@@ -7,7 +7,7 @@
 parameters:
   _param:
     opencontrail_kafka_log_cleanup_mtime: '+7'
-    opencontrail_kafka_log_cleanup_dir: '/usr/share/kafka/logs/'
+    opencontrail_kafka_log_dir: '/usr/share/kafka/logs'
 # Temprorary fix for MOS9 packages to pin old version of kafka
   linux:
     system:
@@ -21,7 +21,7 @@
         - nf_conntrack_ipv4
       job:
         kafka_logs_cleanup:
-          command: "find ${_param:opencontrail_kafka_log_cleanup_dir} -name '*.log.*' -type f -mtime ${_param:opencontrail_kafka_log_cleanup_mtime} -exec rm {} \\;"
+          command: "find ${_param:opencontrail_kafka_log_dir} -name '*.log.*' -type f -mtime ${_param:opencontrail_kafka_log_cleanup_mtime} -exec rm {} \\;"
           identifier: kafka_logs_cleanup
           hour: 0
           minute: 0
diff --git a/opencontrail/control/cluster4_0.yml b/opencontrail/control/cluster4_0.yml
index 381a0d2..5914c50 100644
--- a/opencontrail/control/cluster4_0.yml
+++ b/opencontrail/control/cluster4_0.yml
@@ -6,8 +6,9 @@
 - system.haproxy.proxy.listen.opencontrail.analytics
 parameters:
   _param:
+    opencontrail_kafka_config_dir: '/usr/share/kafka/config'
     opencontrail_kafka_log_cleanup_mtime: '+7'
-    opencontrail_kafka_log_cleanup_dir: '/usr/share/kafka/logs/'
+    opencontrail_kafka_log_dir: '/usr/share/kafka/logs'
     opencontrail_version: 4.0
     linux_repo_contrail_component: oc40
     opencontrail_image_tag: latest
@@ -31,7 +32,7 @@
         - nf_conntrack_ipv4
       job:
         kafka_logs_cleanup:
-          command: "find ${_param:opencontrail_kafka_log_cleanup_dir} -name '*.log.*' -type f -mtime ${_param:opencontrail_kafka_log_cleanup_mtime} -exec rm {} \\;"
+          command: "find ${_param:opencontrail_kafka_log_dir} -name '*.log.*' -type f -mtime ${_param:opencontrail_kafka_log_cleanup_mtime} -exec rm {} \\;"
           identifier: kafka_logs_cleanup
           hour: 0
           minute: 0
@@ -179,10 +180,10 @@
                 - /var/lib/analyticsdb:/var/lib/cassandra
                 - /var/lib/analyticsdb_zookeeper_data:/var/lib/zookeeper
                 - /var/lib/zookeeper/myid:/var/lib/zookeeper/myid
-                - /usr/share/kafka/config/server.properties:/usr/share/kafka/config/server.properties
-                - /usr/share/kafka/config/consumer.properties:/usr/share/kafka/config/consumer.properties
-                - /usr/share/kafka/config/zookeeper.properties:/usr/share/kafka/config/zookeeper.properties
-                - /usr/share/kafka/logs:/usr/share/kafka/logs
+                - ${_param:opencontrail_kafka_config_dir}/server.properties:${_param:opencontrail_kafka_config_dir}/server.properties
+                - ${_param:opencontrail_kafka_config_dir}/consumer.properties:${_param:opencontrail_kafka_config_dir}/consumer.properties
+                - ${_param:opencontrail_kafka_config_dir}/zookeeper.properties:${_param:opencontrail_kafka_config_dir}/zookeeper.properties
+                - ${_param:opencontrail_kafka_log_dir}:${_param:opencontrail_kafka_log_dir}
                 - /etc/zookeeper/conf/zoo_analytics.cfg:/etc/zookeeper/conf/zoo.cfg
                 - /etc/zookeeper/conf/log4j.properties:/etc/zookeeper/conf/log4j.properties
                 - /var/log/contrail:/var/log/contrail
diff --git a/opencontrail/control/cluster4_0_k8s.yml b/opencontrail/control/cluster4_0_k8s.yml
index cb9ce4f..5564ccf 100644
--- a/opencontrail/control/cluster4_0_k8s.yml
+++ b/opencontrail/control/cluster4_0_k8s.yml
@@ -6,7 +6,7 @@
 parameters:
   _param:
     opencontrail_kafka_log_cleanup_mtime: '+7'
-    opencontrail_kafka_log_cleanup_dir: '/usr/share/kafka/logs/'
+    opencontrail_kafka_log_dir: '/usr/share/kafka/logs'
     opencontrail_version: 4.0
     linux_repo_contrail_component: oc40
     opencontrail_image_tag: latest
@@ -30,7 +30,7 @@
         - nf_conntrack_ipv4
       job:
         kafka_logs_cleanup:
-          command: "find ${_param:opencontrail_kafka_log_cleanup_dir} -name '*.log.*' -type f -mtime ${_param:opencontrail_kafka_log_cleanup_mtime} -exec rm {} \\;"
+          command: "find ${_param:opencontrail_kafka_log_dir} -name '*.log.*' -type f -mtime ${_param:opencontrail_kafka_log_cleanup_mtime} -exec rm {} \\;"
           identifier: kafka_logs_cleanup
           hour: 0
           minute: 0
diff --git a/opencontrail/control/single.yml b/opencontrail/control/single.yml
index 2ba745b..ef798bd 100644
--- a/opencontrail/control/single.yml
+++ b/opencontrail/control/single.yml
@@ -4,7 +4,7 @@
 parameters:
   _param:
     opencontrail_kafka_log_cleanup_mtime: '+7'
-    opencontrail_kafka_log_cleanup_dir: '/usr/share/kafka/logs/'
+    opencontrail_kafka_log_dir: '/usr/share/kafka/logs'
 # Temprorary fix for MOS9 packages to pin old version of kafka
   linux:
     system:
@@ -20,7 +20,7 @@
         - nf_conntrack_ipv4
       job:
         kafka_logs_cleanup:
-          command: "find ${_param:opencontrail_kafka_log_cleanup_dir} -name '*.log.*' -type f -mtime ${_param:opencontrail_kafka_log_cleanup_mtime} -exec rm {} \\;"
+          command: "find ${_param:opencontrail_kafka_log_dir} -name '*.log.*' -type f -mtime ${_param:opencontrail_kafka_log_cleanup_mtime} -exec rm {} \\;"
           identifier: kafka_logs_cleanup
           hour: 0
           minute: 0
diff --git a/opencontrail/control/single4_0.yml b/opencontrail/control/single4_0.yml
index 779d8d0..9857221 100644
--- a/opencontrail/control/single4_0.yml
+++ b/opencontrail/control/single4_0.yml
@@ -4,8 +4,9 @@
 - service.haproxy.proxy.single
 parameters:
   _param:
+    opencontrail_kafka_config_dir: '/usr/share/kafka/config'
     opencontrail_kafka_log_cleanup_mtime: '+7'
-    opencontrail_kafka_log_cleanup_dir: '/usr/share/kafka/logs/'
+    opencontrail_kafka_log_dir: '/usr/share/kafka/logs'
     opencontrail_version: 4.0
     linux_repo_contrail_component: oc40
     opencontrail_image_tag: latest
@@ -26,7 +27,7 @@
         - nf_conntrack_ipv4
       job:
         kafka_logs_cleanup:
-          command: "find ${_param:opencontrail_kafka_log_cleanup_dir} -name '*.log.*' -type f -mtime ${_param:opencontrail_kafka_log_cleanup_mtime} -exec rm {} \\;"
+          command: "find ${_param:opencontrail_kafka_log_dir} -name '*.log.*' -type f -mtime ${_param:opencontrail_kafka_log_cleanup_mtime} -exec rm {} \\;"
           identifier: kafka_logs_cleanup
           hour: 0
           minute: 0
@@ -198,10 +199,10 @@
                 - /var/lib/analyticsdb:/var/lib/cassandra
                 - /var/lib/analyticsdb_zookeeper_data:/var/lib/zookeeper
                 - /var/lib/zookeeper/myid:/var/lib/zookeeper/myid
-                - /usr/share/kafka/config/server.properties:/usr/share/kafka/config/server.properties
-                - /usr/share/kafka/config/consumer.properties:/usr/share/kafka/config/consumer.properties
-                - /usr/share/kafka/config/zookeeper.properties:/usr/share/kafka/config/zookeeper.properties
-                - /usr/share/kafka/logs:/usr/share/kafka/logs
+                - ${_param:opencontrail_kafka_config_dir}/server.properties:${_param:opencontrail_kafka_config_dir}/server.properties
+                - ${_param:opencontrail_kafka_config_dir}/consumer.properties:${_param:opencontrail_kafka_config_dir}/consumer.properties
+                - ${_param:opencontrail_kafka_config_dir}/zookeeper.properties:${_param:opencontrail_kafka_config_dir}/zookeeper.properties
+                - ${_param:opencontrail_kafka_log_dir}:${_param:opencontrail_kafka_log_dir}
                 - /etc/zookeeper/conf/zoo_analytics.cfg:/etc/zookeeper/conf/zoo.cfg
                 - /etc/zookeeper/conf/log4j.properties:/etc/zookeeper/conf/log4j.properties
                 - /var/log/contrail:/var/log/contrail