Use auth_url in contrail-keystone-auth

- This fixes the contrail-collector crash, if the contrail-keystone-auth.conf is present and contains admin_token
- Don't use openstackrc and keystonerc in version 3

Change-Id: I0efb42b8059eb54a97ac74546974f66e0b90aad9
diff --git a/opencontrail/common.sls b/opencontrail/common.sls
index 1ff96cc..cbaf5d2 100644
--- a/opencontrail/common.sls
+++ b/opencontrail/common.sls
@@ -105,6 +105,7 @@
   - require:
     - file: /etc/contrail
 
+{%- if common.version < 3.0 %}
 /etc/contrail/openstackrc:
   file.managed:
   - source: salt://opencontrail/files/{{ common.version }}/openstackrc
@@ -119,3 +120,4 @@
   - require:
     - file: /etc/contrail
 {%- endif %}
+{%- endif %}
diff --git a/opencontrail/files/3.0/contrail-api.conf b/opencontrail/files/3.0/contrail-api.conf
index 807de4c..c58f273 100644
--- a/opencontrail/files/3.0/contrail-api.conf
+++ b/opencontrail/files/3.0/contrail-api.conf
@@ -34,18 +34,3 @@
 certfile=/etc/contrail/ssl/certs/apiserver.pem
 ca_certs=/etc/contrail/ssl/certs/ca.pem
 
-{%- if config.identity.engine == "keystone" %}
-[KEYSTONE]
-auth_host={{ config.identity.host }}
-auth_protocol=http
-auth_port={{ config.identity.port }}
-admin_user={{ config.identity.user }}
-admin_password={{ config.identity.password }}
-admin_token={{ config.identity.token }}
-admin_tenant_name={{ config.identity.tenant }}
-insecure=True
-{%- if config.identity.version == "3" %}
-project_name={{ config.identity.tenant }}
-auth_url=http://{{ config.identity.host }}:{{ config.identity.port }}/v3
-{%- endif %}
-{%- endif %}
diff --git a/opencontrail/files/3.0/contrail-keystone-auth.conf b/opencontrail/files/3.0/contrail-keystone-auth.conf
index 22733a3..5619bf2 100644
--- a/opencontrail/files/3.0/contrail-keystone-auth.conf
+++ b/opencontrail/files/3.0/contrail-keystone-auth.conf
@@ -1,14 +1,19 @@
-{%- from "opencontrail/map.jinja" import config with context %}
+{%- from "opencontrail/map.jinja" import config with context -%}
 [KEYSTONE]
 auth_host={{ config.identity.host }}
 auth_protocol=http
 auth_port={{ config.identity.port }}
 admin_user={{ config.identity.user }}
 admin_password={{ config.identity.password }}
-admin_token={{ config.identity.token }}
 admin_tenant_name={{ config.identity.tenant }}
 insecure=True
 {%- if config.cache is defined %}
 #memcache_servers=127.0.0.1:11211
 memcache_servers={% for member in config.cache.members %}{{ member.host }}:{{ member.port }}{% if not loop.last %},{% endif %}{% endfor %}
+{%- endif %}
+{%- if config.identity.version == "3" %}
+project_name={{ config.identity.tenant }}
+auth_url=http://{{ config.identity.host }}:{{ config.identity.port }}/v3
+{%- else %}
+auth_url=http://{{ config.identity.host }}:{{ config.identity.port }}/v2.0
 {%- endif %}
\ No newline at end of file
diff --git a/opencontrail/files/3.0/contrail-schema.conf b/opencontrail/files/3.0/contrail-schema.conf
index e22fd25..2ecfb0b 100644
--- a/opencontrail/files/3.0/contrail-schema.conf
+++ b/opencontrail/files/3.0/contrail-schema.conf
@@ -28,10 +28,3 @@
 certfile=/etc/contrail/ssl/certs/schema_xfer.pem
 ca_certs=/etc/contrail/ssl/certs/ca.pem
 
-{%- if config.identity.engine == "keystone" %}
-[KEYSTONE]
-admin_user={{ config.identity.user }}
-admin_password={{ config.identity.password }}
-admin_token={{ config.identity.token }}
-admin_tenant_name={{ config.identity.tenant }}
-{%- endif %}
\ No newline at end of file
diff --git a/opencontrail/files/3.0/contrail-svc-monitor.conf b/opencontrail/files/3.0/contrail-svc-monitor.conf
index 74d1d34..860ad12 100644
--- a/opencontrail/files/3.0/contrail-svc-monitor.conf
+++ b/opencontrail/files/3.0/contrail-svc-monitor.conf
@@ -34,14 +34,3 @@
 certfile=/etc/contrail/ssl/certs/svc_monitor.pem
 ca_certs=/etc/contrail/ssl/certs/ca.pem
 
-{%- if config.identity.engine == "keystone" %}
-[KEYSTONE]
-auth_host={{ config.identity.host }}
-auth_protocol=http
-auth_port={{ config.identity.port }}
-auth_insecure=True
-admin_user={{ config.identity.user }}
-admin_password={{ config.identity.password }}
-admin_token={{ config.identity.token }}
-admin_tenant_name={{ config.identity.tenant }}
-{%- endif %}
\ No newline at end of file