Parametrized multi_tenancy to enable/disable authentication to Contrail API
Change-Id: I30ef75171a64e9212c4fb296298617316007d2a9
diff --git a/README.rst b/README.rst
index f414d29..576d2ae 100644
--- a/README.rst
+++ b/README.rst
@@ -602,6 +602,20 @@
engine: kubernetes
...
+Disable Contrail API authentication
+-----------------------------------
+
+Contrail version must >=3.0. It is useful especially for Keystone v3.
+
+.. code-block:: yaml
+
+ opencontrail:
+ ...
+ config:
+ multi_tenancy: false
+ ...
+
+
Usage
=====
diff --git a/metadata/service/control/cluster.yml b/metadata/service/control/cluster.yml
index c90a8bd..214d471 100644
--- a/metadata/service/control/cluster.yml
+++ b/metadata/service/control/cluster.yml
@@ -21,6 +21,7 @@
config:
version: ${_param:opencontrail_version}
enabled: true
+ multi_tenancy: true
network:
engine: neutron
host: ${_param:cluster_vip_address}
diff --git a/metadata/service/control/control.yml b/metadata/service/control/control.yml
index 9c46a34..739bbc0 100644
--- a/metadata/service/control/control.yml
+++ b/metadata/service/control/control.yml
@@ -21,6 +21,7 @@
config:
version: ${_param:opencontrail_version}
enabled: true
+ multi_tenancy: true
network:
engine: neutron
host: ${_param:cluster_vip_address}
diff --git a/metadata/service/control/single.yml b/metadata/service/control/single.yml
index 5c76a63..f7d0293 100644
--- a/metadata/service/control/single.yml
+++ b/metadata/service/control/single.yml
@@ -21,6 +21,7 @@
config:
version: ${_param:opencontrail_version}
enabled: true
+ multi_tenancy: true
network:
engine: neutron
host: ${_param:single_address}
diff --git a/opencontrail/files/3.0/contrail-api.conf b/opencontrail/files/3.0/contrail-api.conf
index 52c4f69..06d4df0 100644
--- a/opencontrail/files/3.0/contrail-api.conf
+++ b/opencontrail/files/3.0/contrail-api.conf
@@ -7,7 +7,7 @@
cassandra_server_list={% for member in config.database.members %}{{ member.host }}:{{ member.port }} {% endfor %}
listen_ip_addr=0.0.0.0
listen_port=8082
-multi_tenancy=True
+multi_tenancy={{ config.get('multi_tenancy', 'true')|lower }}
log_file=/var/log/contrail/contrail-api.log
log_local=1
log_level=SYS_NOTICE
diff --git a/tests/pillar/cluster.sls b/tests/pillar/cluster.sls
index 33bb380..2f8a6e2 100644
--- a/tests/pillar/cluster.sls
+++ b/tests/pillar/cluster.sls
@@ -17,6 +17,7 @@
config:
version: 2.2
enabled: true
+ multi_tenancy: false
network:
engine: neutron
host: 127.0.0.1
diff --git a/tests/pillar/control.sls b/tests/pillar/control.sls
index 37ffae9..453733f 100644
--- a/tests/pillar/control.sls
+++ b/tests/pillar/control.sls
@@ -14,6 +14,7 @@
config:
version: 2.2
enabled: true
+ multi_tenancy: false
network:
engine: neutron
host: 127.0.0.1
diff --git a/tests/pillar/single.sls b/tests/pillar/single.sls
index 0c7b9a3..51b2732 100644
--- a/tests/pillar/single.sls
+++ b/tests/pillar/single.sls
@@ -16,6 +16,7 @@
port: 9696
config:
version: 2.2
+ multi_tenancy: false
enabled: true
network:
engine: neutron