RedHat Compatability

Change-Id: Idb228854a8878d01fa3d675d5e3f7c231ed482d0
diff --git a/opencontrail/collector.sls b/opencontrail/collector.sls
index 0b082cc..0c35c86 100644
--- a/opencontrail/collector.sls
+++ b/opencontrail/collector.sls
@@ -48,7 +48,7 @@
 
 {% endif %}
 
-/etc/redis/redis.conf:
+{{ collector.redis_config }}:
   file.managed:
   - source: salt://opencontrail/files/{{ collector.version }}/collector/redis.conf
   - require:
@@ -83,6 +83,6 @@
     - file: /etc/contrail/contrail-analytics-api.conf
     - file: /etc/contrail/contrail-query-engine.conf
     - file: /etc/contrail/contrail-collector.conf
-    - file: /etc/redis/redis.conf
+    - file: {{ collector.redis_config }}
 
-{%- endif %}
\ No newline at end of file
+{%- endif %}
diff --git a/opencontrail/compute.sls b/opencontrail/compute.sls
index 9c3b16f..b6ec393 100644
--- a/opencontrail/compute.sls
+++ b/opencontrail/compute.sls
@@ -14,12 +14,16 @@
   pkg.installed:
   - names: {{ compute.pkgs }}
 
+{%- if grains.os_family == "Debian" %}
+
 /etc/network/if-pre-up.d/if-vhost0:
   file.symlink:
     - target: /usr/lib/contrail/if-vhost0
     - require:
       - pkg: opencontrail_compute_packages
 
+{%- endif %}
+
 net.ipv4.ip_local_reserved_ports:
   sysctl.present:
     - value: 8085,9090
@@ -143,4 +147,4 @@
   service.enabled:
   - names: {{ compute.services }}
 
-{%- endif %}
\ No newline at end of file
+{%- endif %}
diff --git a/opencontrail/database.sls b/opencontrail/database.sls
index 6b482aa..6bcf20a 100644
--- a/opencontrail/database.sls
+++ b/opencontrail/database.sls
@@ -6,39 +6,57 @@
 
 {% if database.cassandra.version == 1 %}
 
-/etc/cassandra/cassandra.yaml:
+{{ database.cassandra_config }}cassandra.yaml:
   file.managed:
   - source: salt://opencontrail/files/cassandra.yaml.1
   - template: jinja
   - makedirs: True
+{% if grains.os_family == "RedHat" %}
+  - require:
+    - pkg: opencontrail_database_packages
+{% endif %}
 
-/etc/cassandra/cassandra-env.sh:
+{{ database.cassandra_config }}cassandra-env.sh:
   file.managed:
   - source: salt://opencontrail/files/cassandra-env.sh.1
   - makedirs: True
+{% if grains.os_family == "RedHat" %}
+  - require:
+    - pkg: opencontrail_database_packages
+{% endif %}
 
 {% else %}
 
-/etc/cassandra/cassandra.yaml:
+{{ database.cassandra_config }}cassandra.yaml:
   file.managed:
   - source: salt://opencontrail/files/{{ database.version }}/cassandra.yaml
   - template: jinja
   - makedirs: True
+{% if grains.os_family == "RedHat" %}
+  - require:
+    - pkg: opencontrail_database_packages
+{% endif %}
 
-/etc/cassandra/cassandra-env.sh:
+{{ database.cassandra_config }}cassandra-env.sh:
   file.managed:
   - source: salt://opencontrail/files/{{ database.version }}/database/cassandra-env.sh
   - template: jinja
   - makedirs: True
+{% if grains.os_family == "RedHat" %}
+  - require:
+    - pkg: opencontrail_database_packages
+{% endif %}
 
 {% endif %}
 
 opencontrail_database_packages:
   pkg.installed:
   - names: {{ database.pkgs }}
+{% if grains.os_family == "Debian" %}
   - require:
-    - file: /etc/cassandra/cassandra.yaml
-    - file: /etc/cassandra/cassandra-env.sh
+    - file: {{ database.cassandra_config }}cassandra.yaml
+    - file: {{ database.cassandra_config }}cassandra-env.sh
+{% endif %}
 
 /etc/zookeeper/conf/log4j.properties:
   file.managed:
@@ -80,8 +98,8 @@
   - enable: true
   - name: supervisor-database
   - watch: 
-    - file: /etc/cassandra/cassandra.yaml
-    - file: /etc/cassandra/cassandra-env.sh
+    - file: {{ database.cassandra_config }}cassandra.yaml
+    - file: {{ database.cassandra_config }}cassandra-env.sh
     - file: /etc/zookeeper/conf/zoo.cfg
     - file: /etc/contrail/contrail-database-nodemgr.conf
     - file: /var/lib/zookeeper/myid
diff --git a/opencontrail/files/2.2/config.global.js b/opencontrail/files/2.2/config.global.js
index 20b10cb..a01b2bb 100644
--- a/opencontrail/files/2.2/config.global.js
+++ b/opencontrail/files/2.2/config.global.js
@@ -208,6 +208,7 @@
 /* Redis DB index for Web-UI */
 config.redisDBIndex = 3;
 
+{% if grains.os_family == "Debian" %}
 /* Logo File: Use complete path of logo file location */
 config.logo_file = '/var/lib/contrail-webui/contrail-web-core/webroot/img/opencontrail-logo.png';
 
@@ -220,6 +221,22 @@
 config.featurePkg.webController.path = '/var/lib/contrail-webui/contrail-web-controller';
 config.featurePkg.webController.enable = true;
 
+{% elif grains.os_family == "RedHat" %}
+
+config.logo_file = '/usr/src/contrail/contrail-web-core/webroot/img/juniper-networks-logo.png';
+
+/* Favicon File: Use complete path of favicon file location */
+config.favicon_file = '/usr/src/contrail/contrail-web-core/webroot/img/juniper-networks-favicon.ico';
+
+config.featurePkg = {};
+/* Add new feature Package Config details below */
+config.featurePkg.webController = {};
+config.featurePkg.webController.path = '/usr/src/contrail/contrail-web-controller';
+config.featurePkg.webController.enable = true;
+
+
+{% endif %}
+
 /* Enable/disable Stat Query Links in Sidebar*/
 config.qe = {};
 config.qe.enable_stat_queries = false;
@@ -267,4 +284,4 @@
 module.exports = config;
 
 config.features = {};
-config.features.disabled = [];
\ No newline at end of file
+config.features.disabled = [];
diff --git a/opencontrail/files/cassandra.yaml.1 b/opencontrail/files/cassandra.yaml.1
index b41fee8..f90c30a 100644
--- a/opencontrail/files/cassandra.yaml.1
+++ b/opencontrail/files/cassandra.yaml.1
@@ -111,10 +111,10 @@
 # will spread data evenly across them, subject to the granularity of
 # the configured compaction strategy.
 data_file_directories:
-    - /home/cassandra/data
+    - /var/lib/cassandra/data
 
 # commit log
-commitlog_directory: /home/cassandra/commitlog
+commitlog_directory: /var/lib/cassandra/commitlog
 
 # policy for data disk failures:
 # stop: shut down gossip and Thrift, leaving the node effectively dead, but
@@ -194,7 +194,7 @@
 row_cache_provider: SerializingCacheProvider
 
 # saved caches
-saved_caches_directory: /home/cassandra/saved_caches
+saved_caches_directory: /var/lib/cassandra/saved_caches
 
 # commitlog_sync may be either "periodic" or "batch." 
 # When in batch mode, Cassandra won't ack writes until the commit log
diff --git a/opencontrail/map.jinja b/opencontrail/map.jinja
index 1d58715..babd74c 100644
--- a/opencontrail/map.jinja
+++ b/opencontrail/map.jinja
@@ -6,17 +6,20 @@
     },
     'RedHat': {
         'source': {'engine': 'pkg', 'address': 'http://'},
+        'pkgs': ['contrail-utils', 'contrail-nodemgr'],
     },
 }, merge=salt['pillar.get']('opencontrail:common')) %}
 
 {% set collector = salt['grains.filter_by']({
     'Debian': {
         'pkgs': ['contrail-analytics'],
+        'redis_config': '/etc/redis/redis.conf',
         'services': ['supervisor-analytics','redis-server']
     },
     'RedHat': {
         'pkgs': ['contrail-analytics'],
-        'services': ['supervisor-analytics']
+        'redis_config': '/etc/redis.conf',
+        'services': ['supervisor-analytics','redis']
     },
 }, merge=salt['pillar.get']('opencontrail:collector')) %}
 
@@ -26,7 +29,7 @@
         'services': ['supervisor-vrouter']
     },
     'RedHat': {
-        'pkgs': ['contrail-vrouter'],
+        'pkgs': ['contrail-openstack-vrouter', 'haproxy', 'contrail-vrouter-source'],
         'services': ['supervisor-vrouter']
     },
 }, merge=salt['pillar.get']('opencontrail:compute')) %}
@@ -37,7 +40,7 @@
         'services': ['zookeeper', 'supervisor-config']
     },
     'RedHat': {
-        'pkgs': ['contrail-config-openstack'],
+        'pkgs': ['contrail-openstack-config'],
         'services': ['zookeeper', 'supervisor-config']
     },
 }, merge=salt['pillar.get']('opencontrail:config')) %}
@@ -48,7 +51,7 @@
         'services': ['contrail-control', 'supervisor-control']
     },
     'RedHat': {
-        'pkgs': ['contrail-control'],
+        'pkgs': ['contrail-openstack-control'],
         'services': ['contrail-control', 'supervisor-control']
     },
 }, merge=salt['pillar.get']('opencontrail:control')) %}
@@ -56,10 +59,12 @@
 {% set database = salt['grains.filter_by']({
     'Debian': {
         'pkgs': ['cassandra', 'zookeeper', 'supervisor', 'openjdk-7-jre-headless','contrail-database'],
+        'cassandra_config': '/etc/cassandra/',
         'services': ['supervisord-contrail-database','zookeeper']
     },
     'RedHat': {
-        'pkgs': ['cassandra', 'zookeeper', 'supervisor', 'openjdk-7-jre-headless'],
+        'pkgs': ['contrail-openstack-database', 'zookeeper', 'supervisor', 'java-1.7.0-openjdk-headless'],
+        'cassandra_config': '/etc/cassandra/conf/',
         'services': ['supervisord-contrail-database','zookeeper']
     },
 }, merge=salt['pillar.get']('opencontrail:database')) %}
@@ -71,7 +76,7 @@
     },
     'RedHat': {
         'pkgs': ['contrail-web-controller'],
-        'services': ['contrail-webui-webserver','contrail-webui-jobserver']
+        'services': ['supervisor-webui']
     },
 }, merge=salt['pillar.get']('opencontrail:web')) %}