Merge "Fix module for linklocal_service_create"
diff --git a/README.rst b/README.rst
index bf4fe01..829e827 100644
--- a/README.rst
+++ b/README.rst
@@ -1533,6 +1533,22 @@
         nodemgr: 10
       ....
 
+Define aging time for flow-records in seconds
+---------------------------------------------
+
+Flows are aged out based on inactivity for a specific period of time. By default,
+the timeout value is 180 seconds. This can be modified by configuring flow_cache_timeout for
+contrail-vrouter-agent service:
+
+.. code-block:: yaml
+
+    opencontrail:
+      ....
+      compute
+        ....
+        flow_cache_timeout: 180
+        ....
+
 Usage
 =====
 
diff --git a/metadata/service/compute/cluster.yml b/metadata/service/compute/cluster.yml
index 50542d1..a3729e8 100644
--- a/metadata/service/compute/cluster.yml
+++ b/metadata/service/compute/cluster.yml
@@ -5,4 +5,15 @@
 parameters:
   opencontrail:
     compute:
-      enabled: true
+      enabled: True
+      version: ${_param:opencontrail_version}
+      disable_flow_collection: False
+      bind:
+        address: ${_param:single_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
\ No newline at end of file
diff --git a/metadata/service/compute/single.yml b/metadata/service/compute/single.yml
index 05ca1bc..115ef4c 100644
--- a/metadata/service/compute/single.yml
+++ b/metadata/service/compute/single.yml
@@ -3,12 +3,17 @@
 classes:
 - service.opencontrail.support
 parameters:
-  _param:
-    opencontrail_version: 2.2
   opencontrail:
     compute:
-      version: ${_param:opencontrail_version}
       enabled: true
+      version: ${_param:opencontrail_version}
+      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/metadata/service/control/analytics.yml b/metadata/service/control/analytics.yml
index 936e5f7..e3fb303 100644
--- a/metadata/service/control/analytics.yml
+++ b/metadata/service/control/analytics.yml
@@ -3,16 +3,6 @@
 classes:
 - service.opencontrail.support
 parameters:
-  _param:
-    opencontrail_version: 2.2
-    opencontrail_identity_protocol: http
-    opencontrail_identity_port: 35357
-    opencontrail_identity_version: '2.0'
-    opencontrail_admin_password: 'none'
-    opencontrail_admin_user: 'contrail'
-    keystone_service_token: 'none'
-    opencontrail_redis_password: 'none'
-    openstack_region: RegionOne
   opencontrail:
     common:
       version: ${_param:opencontrail_version}
diff --git a/metadata/service/control/cluster.yml b/metadata/service/control/cluster.yml
index 2450352..48d048c 100644
--- a/metadata/service/control/cluster.yml
+++ b/metadata/service/control/cluster.yml
@@ -3,16 +3,6 @@
 classes:
 - service.opencontrail.support
 parameters:
-  _param:
-    opencontrail_version: 2.2
-    opencontrail_identity_protocol: http
-    opencontrail_identity_port: 35357
-    opencontrail_identity_version: '2.0'
-    opencontrail_admin_password: 'none'
-    opencontrail_admin_user: 'contrail'
-    keystone_service_token: 'none'
-    opencontrail_redis_password: 'none'
-    openstack_region: RegionOne
   opencontrail:
     common:
       version: ${_param:opencontrail_version}
diff --git a/metadata/service/control/control.yml b/metadata/service/control/control.yml
index 3d618f2..7ea5014 100644
--- a/metadata/service/control/control.yml
+++ b/metadata/service/control/control.yml
@@ -3,16 +3,6 @@
 classes:
 - service.opencontrail.support
 parameters:
-  _param:
-    opencontrail_version: 2.2
-    opencontrail_identity_protocol: http
-    opencontrail_identity_port: 35357
-    opencontrail_identity_version: '2.0'
-    opencontrail_admin_password: 'none'
-    opencontrail_admin_user: 'contrail'
-    keystone_service_token: 'none'
-    openstack_region: RegionOne
-    opencontrail_redis_password: 'none'
   opencontrail:
     common:
       version: ${_param:opencontrail_version}
diff --git a/metadata/service/control/single.yml b/metadata/service/control/single.yml
index 5478d5c..7012569 100644
--- a/metadata/service/control/single.yml
+++ b/metadata/service/control/single.yml
@@ -3,16 +3,6 @@
 classes:
 - service.opencontrail.support
 parameters:
-  _param:
-    opencontrail_version: 2.2
-    opencontrail_identity_protocol: http
-    opencontrail_identity_port: 35357
-    opencontrail_identity_version: '2.0'
-    opencontrail_admin_password: 'none'
-    opencontrail_admin_user: 'contrail'
-    keystone_service_token: 'none'
-    openstack_region: RegionOne
-    opencontrail_redis_password: 'none'
   opencontrail:
     common:
       version: ${_param:opencontrail_version}
diff --git a/opencontrail/files/3.0/contrail-tor-agent.conf b/opencontrail/files/3.0/contrail-tor-agent.conf
index bb19a6c..e4c9439 100644
--- a/opencontrail/files/3.0/contrail-tor-agent.conf
+++ b/opencontrail/files/3.0/contrail-tor-agent.conf
@@ -25,6 +25,9 @@
 
 # Aging time for flow-records in seconds
 # flow_cache_timeout=0
+{%- if compute.flow_cache_timeout is defined %}
+flow_cache_timeout={{ compute.flow_cache_timeout }}
+{%- endif %}
 
 # Hostname of compute-node. If this is not configured value from `hostname`
 # will be taken
diff --git a/opencontrail/files/3.0/contrail-vrouter-agent.conf b/opencontrail/files/3.0/contrail-vrouter-agent.conf
index 29fce04..f057de4 100644
--- a/opencontrail/files/3.0/contrail-vrouter-agent.conf
+++ b/opencontrail/files/3.0/contrail-vrouter-agent.conf
@@ -34,6 +34,9 @@
 
 # Aging time for flow-records in seconds
 # flow_cache_timeout=0
+{%- if compute.flow_cache_timeout is defined %}
+flow_cache_timeout={{ compute.flow_cache_timeout }}
+{%- endif %}
 
 {%- if compute.dpdk.enabled %}
 
diff --git a/opencontrail/files/4.0/contrail-vrouter-agent.conf b/opencontrail/files/4.0/contrail-vrouter-agent.conf
index 397c35d..7bc2fd8 100644
--- a/opencontrail/files/4.0/contrail-vrouter-agent.conf
+++ b/opencontrail/files/4.0/contrail-vrouter-agent.conf
@@ -26,6 +26,9 @@
 
 # Aging time for flow-records in seconds
 # flow_cache_timeout=0
+{%- if compute.flow_cache_timeout is defined %}
+flow_cache_timeout={{ compute.flow_cache_timeout }}
+{%- endif %}
 
 {%- if compute.dpdk.enabled %}
 
diff --git a/opencontrail/meta/salt.yml b/opencontrail/meta/salt.yml
index 21080ce..968da5d 100644
--- a/opencontrail/meta/salt.yml
+++ b/opencontrail/meta/salt.yml
@@ -40,4 +40,10 @@
     require:
     - salt: opencontrail.config
     - salt: opencontrail.collector
+dependency:
+  {% from "opencontrail/map.jinja" import client with context %}
+  {%- if client.get('enabled', False)  %}
+  engine: pkg
+  pkgs: {{ client.pkgs }}
+  {%- endif %}