From d15a9e4a62822af5347bba1f61c41c774de0d8ab Mon Sep 17 00:00:00 2001 From: "chenshuai@huawei.com" Date: Tue, 19 Jan 2016 21:33:41 +0800 Subject: bugfix: opencontrail contrail-snmp-collector configuration error JIRA: COMPASS-280 Change-Id: I51cf44fdf36aa7665ffb7ab04942fb41cefa0027 Signed-off-by: chenshuai@huawei.com --- .../roles/open-contrail/tasks/provision/provision-collector.yml | 2 +- .../ansible/roles/open-contrail/tasks/provision/provision-compute.yml | 4 ++++ .../ansible/roles/open-contrail/tasks/provision/provision-webui.yml | 1 + .../open-contrail/templates/provision/contrail-analytics-api-conf.j2 | 2 +- .../open-contrail/templates/provision/contrail-query-engine-conf.j2 | 4 ++++ .../open-contrail/templates/provision/contrail-vrouter-agent-conf.j2 | 2 +- 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-collector.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-collector.yml index 4077ba64..1143ec5c 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-collector.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-collector.yml @@ -63,7 +63,7 @@ option: "{{ item.option }}" value: "{{ item.value }}" with_items: - - { section: "DEFAULTS", option: "zookeeper", value: "{{ contrail_address }}:2128" } + - { section: "DEFAULTS", option: "zookeeper", value: "{{ contrail_address }}:2181" } - { section: "DISCOVERY", option: "disc_server_ip", value: "{{ contrail_haproxy_address }}" } - { section: "DISCOVERY", option: "disc_server_port", value: "5998" } diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml index 30d836d9..32ca0cce 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml @@ -54,6 +54,10 @@ regexp: "dev=__DEVICE__" line: "dev={{ contrail_vhost_device }}" +- name: "get last ip address" + shell: expr substr `cat /etc/hostname` 5 1 + register: lastip + - name: "fix up contrail vrouter agent config" template: src: "../../templates/provision/contrail-vrouter-agent-conf.j2" diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml index e50f6a63..7fa3ce9a 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml @@ -63,3 +63,4 @@ service: name: "supervisor-webui" state: "restarted" + diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-analytics-api-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-analytics-api-conf.j2 index dd5e121e..9fbeeca5 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-analytics-api-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-analytics-api-conf.j2 @@ -1,5 +1,5 @@ [DEFAULTS] -host_ip = {{ contrail_address }} +host_ip = {{ contrail_haproxy_address }} rest_api_ip = {{ contrail_haproxy_address }} rest_api_port = 8081 #cassandra_server_list = {% for cur_host in groups['controller'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-query-engine-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-query-engine-conf.j2 index 3eb20443..d1228b11 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-query-engine-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-query-engine-conf.j2 @@ -1,6 +1,10 @@ [DEFAULT] hostip = {{ contrail_address }} + + #cassandra_server_list = {% for cur_host in groups['controller'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} + + cassandra_server_list = {% for cur_host in groups['controller'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %} collectors = {{ contrail_haproxy_address }}:8086 diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-vrouter-agent-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-vrouter-agent-conf.j2 index 61a517c9..d15ec386 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-vrouter-agent-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-vrouter-agent-conf.j2 @@ -127,7 +127,7 @@ control_network_ip = {{ contrail_haproxy_address }} name = vhost0 # IP address and prefix in ip/prefix_len format -ip = {{ contrail_vhost_address }}/{{ contrail_prefixlen }} +ip = {{ contrail_vhost_address }}{{ lastip.stdout_lines[0] }}/{{ contrail_prefixlen }} # Gateway IP address for virtual host gateway = {{ contrail_vhost_gateway }} -- cgit 1.2.3-korg