contrail client
diff --git a/metadata/service/client/cluster.yml b/metadata/service/client/cluster.yml
new file mode 100644
index 0000000..05e608b
--- /dev/null
+++ b/metadata/service/client/cluster.yml
@@ -0,0 +1,16 @@
+applications:
+- opencontrail
+parameters:
+ opencontrail:
+ client:
+ identity:
+ engine: keystone
+ host: ${_param:cluster_vip_address}
+ port: 35357
+ tenant: admin
+ user: admin
+ password: ${_param:keystone_admin_password}
+ api:
+ engine: contrail
+ host: ${_param:cluster_vip_address}
+ port: 8082
diff --git a/metadata/service/client/single.yml b/metadata/service/client/single.yml
new file mode 100644
index 0000000..92290b3
--- /dev/null
+++ b/metadata/service/client/single.yml
@@ -0,0 +1,16 @@
+applications:
+- opencontrail
+parameters:
+ opencontrail:
+ client:
+ identity:
+ engine: keystone
+ host: ${_param:cluster_local_address}
+ port: 35357
+ tenant: admin
+ user: admin
+ password: ${_param:keystone_admin_password}
+ api:
+ engine: contrail
+ host: ${_param:cluster_local_address}
+ port: 8082
diff --git a/opencontrail/client.sls b/opencontrail/client.sls
new file mode 100644
index 0000000..386c9ee
--- /dev/null
+++ b/opencontrail/client.sls
@@ -0,0 +1,15 @@
+{%- from "opencontrail/map.jinja" import client with context %}
+{%- if client.enabled %}
+
+opencontrail_client_packages:
+ pkg.installed:
+ - names: {{ client.pkgs }}
+
+/etc/contrail/vnc_api_lib.ini:
+ file.managed:
+ - source: salt://opencontrail/files/client_vnc_api_lib.ini
+ - template: jinja
+ - require:
+ - pkg: opencontrail_client_packages
+
+{%- endif %}
\ No newline at end of file
diff --git a/opencontrail/files/client_vnc_api_lib.ini b/opencontrail/files/client_vnc_api_lib.ini
new file mode 100644
index 0000000..ed4727a
--- /dev/null
+++ b/opencontrail/files/client_vnc_api_lib.ini
@@ -0,0 +1,20 @@
+{%- from "opencontrail/map.jinja" import client with context %}
+[global]
+;WEB_SERVER = 127.0.0.1
+;WEB_PORT = 9696 ; connection through quantum plugin
+
+WEB_SERVER = {{ client.api.host }}
+WEB_PORT = {{ client.api.port }}
+BASE_URL = /
+;BASE_URL = /tenants/infra ; common-prefix for all URLs
+
+; Authentication settings (optional)
+[auth]
+AUTHN_TYPE = keystone
+AUTHN_PROTOCOL = http
+AUTHN_SERVER= {{ client.identity.host }}
+AUTHN_PORT = {{ client.identity.port }}
+AUTHN_TENANT = {{ client.identity.tenant }}
+AUTHN_USER = {{ client.identity.user }}
+AUTHN_PASSWORD = {{ client.identity.password }}
+AUTHN_URL = /v2.0/tokens
\ No newline at end of file
diff --git a/opencontrail/init.sls b/opencontrail/init.sls
index eb0c60c..863a72d 100644
--- a/opencontrail/init.sls
+++ b/opencontrail/init.sls
@@ -21,6 +21,9 @@
{% if pillar.opencontrail.tor is defined %}
- opencontrail.tor
{% endif %}
+{%- if pillar.opencontrail.client is defined %}
+- opencontrail.client
+{%- endif %}
{% if pillar.opencontrail.common is defined %}
- opencontrail.common
{% endif %}
\ No newline at end of file
diff --git a/opencontrail/map.jinja b/opencontrail/map.jinja
index 0b1eb8d..1d58715 100644
--- a/opencontrail/map.jinja
+++ b/opencontrail/map.jinja
@@ -82,4 +82,10 @@
'port': 8086
}
},
-}, merge=salt['pillar.get']('opencontrail:tor')) %}
\ No newline at end of file
+}, merge=salt['pillar.get']('opencontrail:tor')) %}
+
+{% set client = salt['grains.filter_by']({
+ 'Debian': {
+ 'pkgs': ['python-contrail'],
+ }
+}, merge=salt['pillar.get']('opencontrail:client')) %}