Remove hardcoded ports for contrail API, discovery, anal
Change-Id: I6cfdcd334dddce9a816be85dba7bec18da9df7f2
Closes-Bug: #1587166
diff --git a/metadata/service/control/analytics.yml b/metadata/service/control/analytics.yml
index 7a89025..49d2fb8 100644
--- a/metadata/service/control/analytics.yml
+++ b/metadata/service/control/analytics.yml
@@ -23,6 +23,7 @@
enabled: true
bind:
address: ${_param:cluster_local_address}
+ port: 9081
master:
host: ${_param:cluster_local_address}
discovery:
diff --git a/metadata/service/control/cluster.yml b/metadata/service/control/cluster.yml
index 214d471..d76fb59 100644
--- a/metadata/service/control/cluster.yml
+++ b/metadata/service/control/cluster.yml
@@ -32,6 +32,8 @@
host: ${_param:cluster_vip_address}
bind:
address: ${_param:cluster_local_address}
+ api_port: 9100
+ discovery_port: 9110
message_queue:
engine: rabbitmq
host: ${_param:cluster_vip_address}
@@ -84,6 +86,7 @@
enabled: true
bind:
address: ${_param:cluster_local_address}
+ port: 9081
master:
host: ${_param:cluster_local_address}
discovery:
diff --git a/metadata/service/control/control.yml b/metadata/service/control/control.yml
index 739bbc0..97ebdaa 100644
--- a/metadata/service/control/control.yml
+++ b/metadata/service/control/control.yml
@@ -32,6 +32,8 @@
host: ${_param:analytics_vip_address}
bind:
address: ${_param:cluster_local_address}
+ api_port: 9100
+ discovery_port: 9110
message_queue:
engine: rabbitmq
host: ${_param:cluster_vip_address}
diff --git a/metadata/service/control/single.yml b/metadata/service/control/single.yml
index f7d0293..16a8452 100644
--- a/metadata/service/control/single.yml
+++ b/metadata/service/control/single.yml
@@ -32,6 +32,8 @@
host: ${_param:single_address}
bind:
address: ${_param:single_address}
+ api_port: 9100
+ discovery_port: 9110
message_queue:
engine: rabbitmq
host: ${_param:single_address}
@@ -72,6 +74,7 @@
enabled: true
bind:
address: ${_param:single_address}
+ port: 9081
master:
host: ${_param:single_address}
discovery:
diff --git a/opencontrail/files/2.2/config/contrail-api.ini b/opencontrail/files/2.2/config/contrail-api.ini
index edd0a37..673529c 100644
--- a/opencontrail/files/2.2/config/contrail-api.ini
+++ b/opencontrail/files/2.2/config/contrail-api.ini
@@ -1,6 +1,6 @@
[program:contrail-api]
-command=/usr/bin/contrail-api --conf_file /etc/contrail/contrail-api.conf --conf_file /etc/contrail/contrail-keystone-auth.conf --listen_port 910%(process_num)01d --worker_id %(process_num)s
+command=/usr/bin/contrail-api --conf_file /etc/contrail/contrail-api.conf --conf_file /etc/contrail/contrail-keystone-auth.conf --worker_id %(process_num)s
numprocs=1
process_name=%(process_num)s
redirect_stderr=true
diff --git a/opencontrail/files/2.2/config/contrail-discovery.ini b/opencontrail/files/2.2/config/contrail-discovery.ini
index 5e84cbf..9ec47bf 100644
--- a/opencontrail/files/2.2/config/contrail-discovery.ini
+++ b/opencontrail/files/2.2/config/contrail-discovery.ini
@@ -1,6 +1,6 @@
[program:contrail-discovery]
-command=/usr/bin/contrail-discovery --conf_file /etc/contrail/contrail-discovery.conf --listen_port 911%(process_num)01d --worker_id %(process_num)s
+command=/usr/bin/contrail-discovery --conf_file /etc/contrail/contrail-discovery.conf --worker_id %(process_num)s
numprocs=1
process_name=%(process_num)s
redirect_stderr=true
diff --git a/opencontrail/files/2.2/contrail-analytics-api.conf b/opencontrail/files/2.2/contrail-analytics-api.conf
index 05ee4dd..4a498b3 100644
--- a/opencontrail/files/2.2/contrail-analytics-api.conf
+++ b/opencontrail/files/2.2/contrail-analytics-api.conf
@@ -4,7 +4,7 @@
cassandra_server_list={% for member in collector.database.members %}{{ member.host }}:{{ member.port }} {% endfor %}
collectors = {{ collector.bind.address }}:8086
http_server_port = 8090
-rest_api_port = 9081
+rest_api_port = {{ collector.bind.get('port', '8081') }}
rest_api_ip = 0.0.0.0
log_local = 1
log_level = SYS_NOTICE
diff --git a/opencontrail/files/2.2/contrail-api.conf b/opencontrail/files/2.2/contrail-api.conf
index ff1ba58..0a70359 100644
--- a/opencontrail/files/2.2/contrail-api.conf
+++ b/opencontrail/files/2.2/contrail-api.conf
@@ -6,7 +6,7 @@
ifmap_password=api-server
cassandra_server_list={% for member in config.database.members %}{{ member.host }}:{{ member.port }} {% endfor %}
listen_ip_addr=0.0.0.0
-listen_port=8082
+listen_port={{ config.bind.get('api_port', '8082') }}
multi_tenancy=True
log_file=/var/log/contrail/contrail-api.log
log_local=1
diff --git a/opencontrail/files/2.2/contrail-discovery.conf b/opencontrail/files/2.2/contrail-discovery.conf
index c46afd8..3a4e100 100644
--- a/opencontrail/files/2.2/contrail-discovery.conf
+++ b/opencontrail/files/2.2/contrail-discovery.conf
@@ -3,7 +3,7 @@
zk_server_ip={% for member in config.database.members %}{{ member.host }}{% if not loop.last %},{% endif %}{% endfor %}
zk_server_port=2181
listen_ip_addr=0.0.0.0
-listen_port=5998
+listen_port={{ config.bind.get('discovery_port', '5998') }}
log_local=True
log_file=/var/log/contrail/discovery.log
cassandra_server_list={% for member in config.database.members %}{{ member.host }}:{{ member.port }} {% endfor %}
diff --git a/opencontrail/files/3.0/config/contrail-api.ini b/opencontrail/files/3.0/config/contrail-api.ini
index edd0a37..673529c 100644
--- a/opencontrail/files/3.0/config/contrail-api.ini
+++ b/opencontrail/files/3.0/config/contrail-api.ini
@@ -1,6 +1,6 @@
[program:contrail-api]
-command=/usr/bin/contrail-api --conf_file /etc/contrail/contrail-api.conf --conf_file /etc/contrail/contrail-keystone-auth.conf --listen_port 910%(process_num)01d --worker_id %(process_num)s
+command=/usr/bin/contrail-api --conf_file /etc/contrail/contrail-api.conf --conf_file /etc/contrail/contrail-keystone-auth.conf --worker_id %(process_num)s
numprocs=1
process_name=%(process_num)s
redirect_stderr=true
diff --git a/opencontrail/files/3.0/config/contrail-discovery.ini b/opencontrail/files/3.0/config/contrail-discovery.ini
index 5e84cbf..9ec47bf 100644
--- a/opencontrail/files/3.0/config/contrail-discovery.ini
+++ b/opencontrail/files/3.0/config/contrail-discovery.ini
@@ -1,6 +1,6 @@
[program:contrail-discovery]
-command=/usr/bin/contrail-discovery --conf_file /etc/contrail/contrail-discovery.conf --listen_port 911%(process_num)01d --worker_id %(process_num)s
+command=/usr/bin/contrail-discovery --conf_file /etc/contrail/contrail-discovery.conf --worker_id %(process_num)s
numprocs=1
process_name=%(process_num)s
redirect_stderr=true
diff --git a/opencontrail/files/3.0/contrail-analytics-api.conf b/opencontrail/files/3.0/contrail-analytics-api.conf
index 05ee4dd..4a498b3 100644
--- a/opencontrail/files/3.0/contrail-analytics-api.conf
+++ b/opencontrail/files/3.0/contrail-analytics-api.conf
@@ -4,7 +4,7 @@
cassandra_server_list={% for member in collector.database.members %}{{ member.host }}:{{ member.port }} {% endfor %}
collectors = {{ collector.bind.address }}:8086
http_server_port = 8090
-rest_api_port = 9081
+rest_api_port = {{ collector.bind.get('port', '8081') }}
rest_api_ip = 0.0.0.0
log_local = 1
log_level = SYS_NOTICE
diff --git a/opencontrail/files/3.0/contrail-api.conf b/opencontrail/files/3.0/contrail-api.conf
index 06d4df0..ff92939 100644
--- a/opencontrail/files/3.0/contrail-api.conf
+++ b/opencontrail/files/3.0/contrail-api.conf
@@ -6,7 +6,7 @@
ifmap_password=api-server
cassandra_server_list={% for member in config.database.members %}{{ member.host }}:{{ member.port }} {% endfor %}
listen_ip_addr=0.0.0.0
-listen_port=8082
+listen_port={{ config.bind.get('api_port', '8082') }}
multi_tenancy={{ config.get('multi_tenancy', 'true')|lower }}
log_file=/var/log/contrail/contrail-api.log
log_local=1
@@ -43,4 +43,4 @@
project_name={{ config.identity.tenant }}
auth_url=http://{{ config.identity.host }}:{{ config.identity.port }}/v3
{%- endif %}
-{%- endif %}
\ No newline at end of file
+{%- endif %}
diff --git a/opencontrail/files/3.0/contrail-discovery.conf b/opencontrail/files/3.0/contrail-discovery.conf
index c46afd8..3a4e100 100644
--- a/opencontrail/files/3.0/contrail-discovery.conf
+++ b/opencontrail/files/3.0/contrail-discovery.conf
@@ -3,7 +3,7 @@
zk_server_ip={% for member in config.database.members %}{{ member.host }}{% if not loop.last %},{% endif %}{% endfor %}
zk_server_port=2181
listen_ip_addr=0.0.0.0
-listen_port=5998
+listen_port={{ config.bind.get('discovery_port', '5998') }}
log_local=True
log_file=/var/log/contrail/discovery.log
cassandra_server_list={% for member in config.database.members %}{{ member.host }}:{{ member.port }} {% endfor %}