aboutsummaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
authorchenshuai@huawei.com <chenshuai@huawei.com>2015-12-29 17:27:25 +0800
committerchenshuai@huawei.com <chenshuai@huawei.com>2015-12-31 09:28:36 +0800
commit55baaadf3ee21bf5769ee791533b66d28f9455ef (patch)
tree4972789da9d8b5eb807f8a3466261a8e219cea86 /deploy
parent48286d3db939134823792b9bff7451d554e86f24 (diff)
bugfix: opencontrail add force parameter for apt-get install
JIRA: COMPASS-227 Change-Id: I4e9ae9dfed29f6d58c9200d21f09cf2a71961ca1 Signed-off-by: chenshuai@huawei.com <chenshuai@huawei.com>
Diffstat (limited to 'deploy')
-rw-r--r--deploy/adapters/ansible/roles/open-contrail/1201
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml2
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml3
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml4
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml2
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml2
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml2
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml2
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml2
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/-vrouter-compute-setup.yml26
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml4
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-database.yml16
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-rabbitmq.yml3
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-toragent.yml4
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml4
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-analytics-api-conf.j26
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-api-conf.j28
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-collector-conf.j22
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-device-manager-conf.j24
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-discovery-conf.j26
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-dns-conf.j22
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-query-engine-conf.j25
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-schema-conf.j210
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-svc-monitor-conf.j26
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-tor-agent-conf.j22
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/templates/provision/haproxy-contrail-cfg.j269
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-env-conf.j22
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/templates/provision/vrouter-nodemgr-param.j23
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/vars/main.yml17
29 files changed, 338 insertions, 81 deletions
diff --git a/deploy/adapters/ansible/roles/open-contrail/1 b/deploy/adapters/ansible/roles/open-contrail/1
new file mode 100644
index 00000000..70159aff
--- /dev/null
+++ b/deploy/adapters/ansible/roles/open-contrail/1
@@ -0,0 +1,201 @@
+---
+#- hosts: database
+# sudo: yes
+# tasks:
+
+
+- name: "enable supervisor database"
+# sudo: True
+ file:
+ path: "/etc/init/supervisor-database.override"
+ state: "absent"
+
+
+- name: "-node-common"
+# sudo: True
+ include: -node-common.yml
+
+
+- name: "update hosts"
+# sudo: True
+ lineinfile:
+ dest: "/etc/hosts"
+# regexp: "^{{ contrail_address }}\t{{ ansible_hostname }}( .*)?$"
+# line: "{{ contrail_address }}\t{{ ansible_hostname }}\\1"
+ regexp: "^{{ contrail_address }}\t{{ inventory_hostname }}( .*)?$"
+ line: "{{ contrail_address }}\t{{ inventory_hostname }}\\1"
+ backrefs: yes
+
+
+- name: "make directory for contrail analytics"
+# sudo: True
+ file:
+ path: "/var/lib/cassandra/data/ContrailAnalytics"
+ state: "directory"
+
+
+- name: "modify cassandra conf"
+# sudo: True
+ lineinfile:
+ dest: "/etc/cassandra/cassandra.yaml"
+ regexp: "{{ item.regexp }}"
+ line: "{{ item.line }}"
+ with_items:
+ - { regexp: "^(#(\\s*)?)?listen_address:", line: "listen_address: {{ contrail_address }}"}
+ - { regexp: "^(#(\\s*)?)?cluster_name:", line: "cluster_name: \"Contrail\"" }
+ - { regexp: "^(#(\\s*)?)?rpc_address:", line: "rpc_address: {{ contrail_address }}" }
+ - { regexp: "^(#(\\s*)?)?num_tokens:", line: "num_tokens: 256" }
+ - { regexp: "^(#(\\s*)?)?initial_token:", line: "# initial_token:" }
+
+
+
+- name: "set first database host seed"
+# sudo: True
+ set_fact:
+# dbseeds: "{{ hostvars[item.1][ contrail_address ] }}"
+ dbseeds: "{{ haproxy_hosts.values()[0] }}"
+ with_indexed_items: groups['opencontrail_database']
+ when: item.0 == 0
+
+
+
+
+
+- name: "set second database host seed"
+# sudo: True
+ set_fact:
+# dbseeds: "{{ dbseeds }},{{ hostvars[item.1]['contrail_address'] }}"
+ dbseeds: "{{ dbseeds }},{{ haproxy_hosts.values()[0] }}"
+ with_indexed_items: groups['opencontrail_database']
+ when: item.0 == 1
+
+
+- name: "modify seeds list in cassandra conf"
+# sudo: True
+ replace:
+ dest: "/etc/cassandra/cassandra.yaml"
+ regexp: "- seeds:.*$"
+ replace: "- seeds: {{ dbseeds }}"
+
+
+- name: "modify cassandra env"
+# sudo: True
+ replace:
+ dest: "/etc/cassandra/cassandra-env.sh"
+ regexp: "{{ item.regexp }}"
+ replace: "{{ item.replace }}"
+ with_items:
+ - { regexp: "(#(\\s*)?)?JVM_OPTS=\"\\$JVM_OPTS -XX:\\+PrintGCDetails\"", replace: "JVM_OPTS=\"$JVM_OPTS -XX:+PrintGCDetails\"" }
+ - { regexp: "(#(\\s*)?)?JVM_OPTS=\"\\$JVM_OPTS -Xss\\d+k\"", replace: "JVM_OPTS=\"$JVM_OPTS -Xss512k\"" }
+ - { regexp: "(#(\\s*)?)?JVM_OPTS=\"\\$JVM_OPTS -XX:\\+PrintGCDateStamps\"", replace: "JVM_OPTS=\"$JVM_OPTS -XX:+PrintGCDateStamps\"" }
+ - { regexp: "(#(\\s*)?)?JVM_OPTS=\"\\$JVM_OPTS -XX:\\+PrintHeapAtGC\"", replace: "JVM_OPTS=\"$JVM_OPTS -XX:+PrintHeapAtGC\"" }
+ - { regexp: "(#(\\s*)?)?JVM_OPTS=\"\\$JVM_OPTS -XX:\\+PrintTenuringDistribution\"", replace: "JVM_OPTS=\"$JVM_OPTS -XX:+PrintTenuringDistribution\"" }
+ - { regexp: "(#(\\s*)?)?JVM_OPTS=\"\\$JVM_OPTS -XX:\\+PrintGCApplicationStoppedTime\"", replace: "JVM_OPTS=\"$JVM_OPTS -XX:+PrintGCApplicationStoppedTime\"" }
+ - { regexp: "(#(\\s*)?)?JVM_OPTS=\"\\$JVM_OPTS -XX:\\+PrintPromotionFailure\"", replace: "JVM_OPTS=\"$JVM_OPTS -XX:+PrintPromotionFailure\"" }
+ - { regexp: "(#(\\s*)?)?JVM_OPTS=\"\\$JVM_OPTS -XX:PrintFLSStatistics=1\"", replace: "JVM_OPTS=\"$JVM_OPTS -XX:PrintFLSStatistics=1\"" }
+ - { regexp: "(#(\\s*)?)?JVM_OPTS=\"\\$JVM_OPTS -Xloggc:/var/log/cassandra/gc-`date \\+%s`\\.log\"", replace: "JVM_OPTS=\"$JVM_OPTS -Xloggc:/var/log/cassandra/gc-`date +%s`.log\"" }
+
+
+- name: "modify zookeeper conf"
+# sudo: True
+ lineinfile:
+ dest: "/etc/zookeeper/conf/zoo.cfg"
+ line: "{{ item }}"
+ with_items:
+ - "maxSessionTimeout=120000"
+ - "autopurge.purgeInterval=3"
+
+
+- name: "modify zookeeper log4j properties"
+# sudo: True
+ lineinfile:
+ dest: "/etc/zookeeper/conf/log4j.properties"
+ regexp: "(log4j.appender.ROLLINGFILE.MaxBackupIndex=.*)$"
+ line: "\\1"
+ backrefs: yes
+
+
+- name: "add server addresses to zookeeper config"
+# sudo: True
+ lineinfile:
+ dest: "/etc/zookeeper/conf/zoo.cfg"
+ regexp: "server.{{ item.0 + 1 }}="
+# line: "server.{{ item.0 + 1 }}={{ hostvars[item.1]['contrail_address'] }}:2888:3888"
+ line: "server.{{ item.0 + 1 }}={{ haproxy_hosts.values()[0] }}:2888:3888"
+ with_indexed_items: groups['opencontrail_database']
+
+
+- name: "set zookeeper unique id"
+# sudo: True
+ template:
+ src: "../../templates/provision/zookeeper-unique-id.j2"
+ dest: "/var/lib/zookeeper/myid"
+ with_indexed_items: groups['opencontrail_database']
+ when: item.1 == inventory_hostname
+
+
+- name: "remove kafka ini file"
+# sudo: True
+ file:
+ path: "/etc/contrail/supervisord_database_files/kafka.ini"
+ state: "absent"
+
+
+- name: "set first zookeeper host address"
+# sudo: True
+ set_fact:
+# zkaddrs: "{{ hostvars[item.1]['contrail_address'] }}:2181"
+ zkaddrs: "{{ haproxy_hosts.values()[0] }}:2181"
+ with_indexed_items: groups['opencontrail_database']
+ when: item.0 == 0
+
+
+- name: "set second or more zookeeper host addresses"
+# sudo: True
+ set_fact:
+# zkaddrs: "{{ zkaddrs }},{{ hostvars[item.1]['contrail_address'] }}:2181"
+ zkaddrs: "{{ zkaddrs }},{{ haproxy_hosts.values()[0] }}:2181"
+ with_indexed_items: groups['opencontrail_database']
+ when: item.0 > 0
+
+
+- name: "modify zookeeper host addresses in kafka properties"
+# sudo: True
+ lineinfile:
+ dest: "/usr/share/kafka/config/server.properties"
+ regexp: "zookeeper.connect="
+ line: "zookeeper.connect={{ zkaddrs }}"
+
+
+- name: "modify kafka properties"
+# sudo: True
+ lineinfile:
+ dest: "/usr/share/kafka/config/server.properties"
+ regexp: "default.replication.factor="
+ line: "default.replication.factor=2"
+
+
+- name: "fix up contrail database nodemgr config"
+# sudo: True
+ ini_file:
+ dest: "/etc/contrail/contrail-database-nodemgr.conf"
+ section: "{{ item.section }}"
+ option: "{{ item.option }}"
+ value: "{{ item.value }}"
+ with_items:
+ - { section: "DEFAULT", option: "hostip", value: "{{ contrail_address }}" }
+ - { section: "DISCOVERY", option: "server", value: "{{ contrail_haproxy_address }}" }
+
+
+- name: "restart zookeeper"
+# sudo: True
+ service:
+ name: "zookeeper"
+ state: "restarted"
+
+
+- name: "restart supervisor database"
+# sudo: True
+ service:
+ name: "supervisor-database"
+ state: "restarted"
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml
index 5dbf9244..cac370e4 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml
@@ -12,5 +12,5 @@
- name: "install contrail openstack analytics package"
# apt:
# name: "contrail-openstack-analytics"
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
with_items: collector_packages
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml
index 3a57fdf0..e963e160 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml
@@ -20,6 +20,7 @@
# sudo: True
apt:
deb: "/tmp/{{ package }}"
+ force: yes
- name: "delete temporary contrail install package"
# sudo: True
@@ -56,6 +57,7 @@
# sudo: True
apt:
deb: "{{ item }}"
+ force: yes
with_items: required_packages.stdout_lines
ignore_errors: True
@@ -91,3 +93,4 @@
apt:
name: "contrail-setup"
update_cache: yes
+ force: yes
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml
index 6c85ce55..3703522d 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml
@@ -18,7 +18,7 @@
# name: "contrail-vrouter-3.13.0-40-generic"
# when: ansible_kernel == "3.13.0-40-generic"
# sudo: True
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
with_items: vrouter_packages
when: ansible_kernel == kernel_required
@@ -27,7 +27,7 @@
# name: "contrail-vrouter-dkms"
# when: ansible_kernel != "3.13.0-40-generic"
# sudo: True
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
with_items: dkms_packages
when: ansible_kernel != kernel_required
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml
index 1d493f58..e8d4f040 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml
@@ -20,5 +20,5 @@
# sudo: True
# apt:
# name: "contrail-openstack-config"
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
with_items: config_packages
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml
index 7e917d16..a1f53076 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml
@@ -20,5 +20,5 @@
# sudo: True
# apt:
# name: "contrail-openstack-control"
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
with_items: control_packages
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml
index 68c5946b..364fc8e3 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml
@@ -13,5 +13,5 @@
# sudo: True
# apt:
# name: "contrail-openstack-database"
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
with_items: database_packages
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml
index 8b0e3347..f1ccfede 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml
@@ -11,7 +11,7 @@
# name: "linux-image-3.13.0-40-generic"
# name: "linux-image-extra-3.13.0-40-generic"
# when: (kernel_install) and (ansible_kernel != "3.13.0-40-generic")
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
with_items: kernel_packages | union(kernel_packages_noarch)
when: (kernel_install) and (ansible_kernel != kernel_required)
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml
index 22156ca3..727c4947 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml
@@ -14,5 +14,5 @@
# sudo: True
# apt:
# name: "contrail-openstack-webui"
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
with_items: webui_packages
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/-vrouter-compute-setup.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/-vrouter-compute-setup.yml
index 77ee20e3..f53e38ec 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/-vrouter-compute-setup.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/-vrouter-compute-setup.yml
@@ -31,21 +31,21 @@
- { section: "DEFAULT", option: "auth_strategy", value: "keystone" }
- { section: "DEFAULT", option: "libvirt_nonblocking", value: "True" }
- { section: "DEFAULT", option: "libvirt_inject_partition", value: "-1" }
- - { section: "DEFAULT", option: "rabbit_host", value: "{{ hostvars[groups['config'][0]]['contrail_address'] }}" }
+ - { section: "DEFAULT", option: "rabbit_host", value: "{{ contrail_haproxy_address }}" }
- { section: "DEFAULT", option: "rabbit_port", value: "5672" }
- - { section: "DEFAULT", option: "glance_host", value: "{{ hostvars[groups['openstack'][0]]['contrail_address'] }}" }
+ - { section: "DEFAULT", option: "glance_host", value: "{{ contrail_haproxy_address }}" }
- { section: "DEFAULT", option: "glance_port", value: "9292" }
- { section: "DEFAULT", option: "neutron_admin_tenant_name", value: "service" }
- { section: "DEFAULT", option: "neutron_admin_username", value: "neutron" }
- { section: "DEFAULT", option: "neutron_admin_password", value: "{{ contrail_admin_password }}" }
- - { section: "DEFAULT", option: "neutron_admin_auth_url", value: "http://{{ hostvars[groups['openstack'][0]]['contrail_address'] }}:35357/v2.0/" }
- - { section: "DEFAULT", option: "neutron_url", value: "http://{{ hostvars[groups['config'][0]]['contrail_address'] }}:9696/" }
+ - { section: "DEFAULT", option: "neutron_admin_auth_url", value: "http://{{ contrail_haproxy_address }}:35357/v2.0/" }
+ - { section: "DEFAULT", option: "neutron_url", value: "http://{{ contrail_haproxy_address }}:9696/" }
- { section: "DEFAULT", option: "neutron_url_timeout", value: "300" }
- { section: "DEFAULT", option: "network_api_class", value: "nova.network.neutronv2.api.API" }
- { section: "DEFAULT", option: "compute_driver", value: "libvirt.LibvirtDriver" }
- { section: "DEFAULT", option: "network_api_class", value: " nova_contrail_vif.contrailvif.ContrailNetworkAPI" }
- { section: "DEFAULT", option: "ec2_private_dns_show_ip", value: "False" }
- - { section: "DEFAULT", option: "novncproxy_base_url", value: "http://{{ hostvars[groups['openstack'][0]]['contrail_mgmt_address'] }}:5999/vnc_auto.html" }
+ - { section: "DEFAULT", option: "novncproxy_base_url", value: "http://{{ contrail_haproxy_address }}:5999/vnc_auto.html" }
- { section: "DEFAULT", option: "vncserver_enabled", value: "True" }
- { section: "DEFAULT", option: "vncserver_listen", value: "{{ contrail_address }}" }
- { section: "DEFAULT", option: "vncserver_proxyclient_address", value: "{{ contrail_address }}" }
@@ -54,16 +54,28 @@
- { section: "DEFAULT", option: "image_cache_manager_interval", value: "0" }
- { section: "DEFAULT", option: "libvirt_cpu_mode", value: "none" }
- { section: "DEFAULT", option: "libvirt_vif_driver", value: "nova_contrail_vif.contrailvif.VRouterVIFDriver" }
- - { section: "database", option: "connection", value: "mysql://nova:nova@{{ hostvars[groups['openstack'][0]]['contrail_address'] }}/nova?charset=utf8" }
+ - { section: "database", option: "connection", value: "mysql://nova:nova@{{ contrail_haproxy_address }}/nova?charset=utf8" }
- { section: "database", option: "idle_timeout", value: "180" }
- { section: "database", option: "max_retries", value: "-1" }
- { section: "keystone_authtoken", option: "admin_tenant_name", value: "service" }
- { section: "keystone_authtoken", option: "admin_user", value: "nova" }
- { section: "keystone_authtoken", option: "admin_password", value: "{{ contrail_admin_password }}" }
- { section: "keystone_authtoken", option: "auth_protocol", value: "http" }
- - { section: "keystone_authtoken", option: "auth_host", value: "{{ hostvars[groups['openstack'][0]]['contrail_address'] }}" }
+ - { section: "keystone_authtoken", option: "auth_host", value: "{{ contrail_haproxy_address }}" }
- { section: "keystone_authtoken", option: "signing_dir", value: "/tmp/keystone-signing-nova" }
+
+
+#- { section: "DEFAULT", option: "rabbit_host", value: "{{ hostvars[groups['config'][0]]['contrail_address'] }}" }
+#- { section: "DEFAULT", option: "glance_host", value: "{{ hostvars[groups['openstack'][0]]['contrail_address'] }}" }
+#- { section: "DEFAULT", option: "neutron_admin_auth_url", value: "http://{{ hostvars[groups['openstack'][0]]['contrail_address'] }}:35357/v2.0/" }
+#- { section: "DEFAULT", option: "neutron_url", value: "http://{{ hostvars[groups['config'][0]]['contrail_address'] }}:9696/" }
+#- { section: "DEFAULT", option: "novncproxy_base_url", value: "http://{{ hostvars[groups['openstack'][0]]['contrail_mgmt_address'] }}:5999/vnc_auto.html" }
+#- { section: "database", option: "connection", value: "mysql://nova:nova@{{ hostvars[groups['openstack'][0]]['contrail_address'] }}/nova?charset=utf8" }
+#- { section: "keystone_authtoken", option: "auth_host", value: "{{ hostvars[groups['openstack'][0]]['contrail_address'] }}" }
+
+
+
- name: "change database address if same node as first openstack node"
ini_file:
dest: "/etc/nova/nova.conf"
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml
index 1a5ddf7b..3da783e1 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml
@@ -16,14 +16,14 @@
lineinfile:
dest: "/etc/ifmap-server/basicauthusers.properties"
# line: "{{ hostvars[item]['contrail_address' ] }}:{{ hostvars[item]['contrail_address' ] }}"
- line: "{{ contrail_address }}:{{ contrail_address }}"
+ line: "{{ haproxy_hosts[item] }}:{{ haproxy_hosts[item] }}"
with_items: groups['opencontrail_control']
- name: "modify ifmap server basicauthusers properties for dns"
lineinfile:
dest: "/etc/ifmap-server/basicauthusers.properties"
# line: "{{ hostvars[item]['contrail_address' ] }}.dns:{{ hostvars[item]['contrail_address' ] }}.dns"
- line: "{{ contrail_address }}.dns:{{ contrail_address }}.dns"
+ line: "{{ haproxy_hosts[item] }}.dns:{{ haproxy_hosts[item] }}.dns"
with_items: groups['opencontrail_control']
- name: "node-common"
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-database.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-database.yml
index f95e7feb..04a1c993 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-database.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-database.yml
@@ -20,8 +20,10 @@
# sudo: True
lineinfile:
dest: "/etc/hosts"
- regexp: "^{{ contrail_address }}\t{{ ansible_hostname }}( .*)?$"
- line: "{{ contrail_address }}\t{{ ansible_hostname }}\\1"
+# regexp: "^{{ contrail_address }}\t{{ ansible_hostname }}( .*)?$"
+# line: "{{ contrail_address }}\t{{ ansible_hostname }}\\1"
+ regexp: "^{{ contrail_address }}\t{{ inventory_hostname }}( .*)?$"
+ line: "{{ contrail_address }}\t{{ inventory_hostname }}\\1"
backrefs: yes
@@ -51,7 +53,7 @@
# sudo: True
set_fact:
# dbseeds: "{{ hostvars[item.1][ contrail_address ] }}"
- dbseeds: "{{ contrail_address }}"
+ dbseeds: "{{ haproxy_hosts[item] }}"
with_indexed_items: groups['opencontrail_database']
when: item.0 == 0
@@ -63,7 +65,7 @@
# sudo: True
set_fact:
# dbseeds: "{{ dbseeds }},{{ hostvars[item.1]['contrail_address'] }}"
- dbseeds: "{{ dbseeds }},{{ contrail_address }}"
+ dbseeds: "{{ dbseeds }},{{ haproxy_hosts[item] }}"
with_indexed_items: groups['opencontrail_database']
when: item.0 == 1
@@ -119,7 +121,7 @@
dest: "/etc/zookeeper/conf/zoo.cfg"
regexp: "server.{{ item.0 + 1 }}="
# line: "server.{{ item.0 + 1 }}={{ hostvars[item.1]['contrail_address'] }}:2888:3888"
- line: "server.{{ item.0 + 1 }}={{ contrail_address }}:2888:3888"
+ line: "server.{{ item.0 + 1 }}={{ haproxy_hosts[item] }}:2888:3888"
with_indexed_items: groups['opencontrail_database']
@@ -143,7 +145,7 @@
# sudo: True
set_fact:
# zkaddrs: "{{ hostvars[item.1]['contrail_address'] }}:2181"
- zkaddrs: "{{ contrail_address }}:2181"
+ zkaddrs: "{{ haproxy_hosts[item] }}:2181"
with_indexed_items: groups['opencontrail_database']
when: item.0 == 0
@@ -152,7 +154,7 @@
# sudo: True
set_fact:
# zkaddrs: "{{ zkaddrs }},{{ hostvars[item.1]['contrail_address'] }}:2181"
- zkaddrs: "{{ zkaddrs }},{{ contrail_address }}:2181"
+ zkaddrs: "{{ zkaddrs }},{{ haproxy_hosts[item] }}:2181"
with_indexed_items: groups['opencontrail_database']
when: item.0 > 0
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-rabbitmq.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-rabbitmq.yml
index b2785d8f..58037bce 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-rabbitmq.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-rabbitmq.yml
@@ -29,7 +29,8 @@
# sudo: True
lineinfile:
dest: "/etc/hosts"
- line: "{{ hostvars[item]['contrail_address'] }}\t{{ hostvars[item]['ansible_hostname'] }} {{ hostvars[item]['ansible_hostname'] }}-ctrl"
+# line: "{{ hostvars[item]['contrail_address'] }}\t{{ hostvars[item]['ansible_hostname'] }} {{ hostvars[item]['ansible_hostname'] }}-ctrl"
+ line: "{{ contrail_address }}\t{{ inventory_hostname }} {{ inventory_hostname }}-ctrl"
with_items: groups['opencontrail_config']
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-toragent.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-toragent.yml
index 87810732..78b01e3f 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-toragent.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-toragent.yml
@@ -69,9 +69,9 @@
run_once: yes
- name: "add tor agent to contrail"
- shell: "python /opt/contrail/utils/provision_vrouter.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --admin_tenant_name admin --openstack_ip {{ contrail_keystone_address }} --oper add --host_name {{ ansible_hostname }}-{{ item.ansible_facts.toragent_index }} --host_ip {{ contrail_address }} --router_type tor-agent"
+ shell: "python /opt/contrail/utils/provision_vrouter.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --admin_tenant_name admin --openstack_ip {{ contrail_keystone_address }} --oper add --host_name {{ inventory_hostname }}-{{ item.ansible_facts.toragent_index }} --host_ip {{ contrail_address }} --router_type tor-agent"
with_items: contrail_toragent_list.results
- name: "add device to contrail"
- shell: "python /opt/contrail/utils/provision_physical_device.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --admin_tenant_name admin --openstack_ip {{ contrail_keystone_address }} --oper add --device_name {{ item.ansible_facts.toragent_params.name }} --vendor_name {{ item.ansible_facts.toragent_params.vendor_name }} --product_name {{ item.ansible_facts.toragent_params.product_name }} --device_mgmt_ip {{ item.ansible_facts.toragent_params.address }} --device_tunnel_ip {{ item.ansible_facts.toragent_params.tunnel_address }} --device_tor_agent {{ ansible_hostname }}-{{ item.ansible_facts.toragent_index }} --device_tsn {{ ansible_hostname }}"
+ shell: "python /opt/contrail/utils/provision_physical_device.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --admin_tenant_name admin --openstack_ip {{ contrail_keystone_address }} --oper add --device_name {{ item.ansible_facts.toragent_params.name }} --vendor_name {{ item.ansible_facts.toragent_params.vendor_name }} --product_name {{ item.ansible_facts.toragent_params.product_name }} --device_mgmt_ip {{ item.ansible_facts.toragent_params.address }} --device_tunnel_ip {{ item.ansible_facts.toragent_params.tunnel_address }} --device_tor_agent {{ inventory_hostname }}-{{ item.ansible_facts.toragent_index }} --device_tsn {{ inventory_hostname }}"
with_items: contrail_toragent_list.results
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 1090ddaa..515b10e9 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
@@ -17,14 +17,14 @@
- name: "set first cassandra host address"
set_fact:
# cassandra_addrs: "'{{ hostvars[item.1]['contrail_address'] }}'"
- cassandra_addrs: "'{{ contrail_address }}'"
+ cassandra_addrs: "'{{ haproxy_hosts[item] }}'"
with_indexed_items: groups['opencontrail_database']
when: item.0 == 0
- name: "set second or more cassandra host addresses"
set_fact:
# cassandra_addrs: "{{ cassandra_addrs }}, '{{ hostvars[item.1]['contrail_address'] }}'"
- cassandra_addrs: "{{ cassandra_addrs }}, '{{ contrail_address }}'"
+ cassandra_addrs: "{{ cassandra_addrs }}, '{{ haproxy_hosts[item] }}'"
with_indexed_items: groups['opencontrail_database']
when: item.0 > 0
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 f5586349..6e2bcce3 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,8 +1,10 @@
[DEFAULTS]
host_ip = {{ contrail_address }}
-rest_api_ip = 0.0.0.0
+rest_api_ip = {{ contrail_haproxy_address }}
rest_api_port = 9081
-cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+#cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+#chenshuai: This kind of written is also correct, but the following is better, this as record
+cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
collectors = {{ contrail_address }}:8086
http_server_port = 8090
diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-api-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-api-conf.j2
index cb747638..e4acf3ea 100755
--- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-api-conf.j2
+++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-api-conf.j2
@@ -1,13 +1,13 @@
[DEFAULTS]
-listen_ip_addr = 0.0.0.0
+listen_ip_addr = {{ contrail_haproxy_address }}
listen_port = 8082
-ifmap_server_ip = {{ contrail_address }}
+ifmap_server_ip = {{ contrail_haproxy_address }}
ifmap_server_port = 8443
ifmap_username = api-server
ifmap_password = api-server
-zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:2181{% if not loop.last %}, {% endif %}{% endfor %}
+zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:2181{% if not loop.last %}, {% endif %}{% endfor %}
-cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
disc_server_ip = {{ contrail_haproxy_address }}
disc_server_port = 5998
diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-collector-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-collector-conf.j2
index ea843880..da5cf2ab 100755
--- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-collector-conf.j2
+++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-collector-conf.j2
@@ -13,7 +13,7 @@ analytics_flow_ttl = -1
# IP address and port to be used to connect to cassandra.
# Multiple IP:port strings separated by space can be provided
-cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
# IP address and port to be used to connect to kafka.
diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-device-manager-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-device-manager-conf.j2
index 24575aa3..7ab29f6f 100755
--- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-device-manager-conf.j2
+++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-device-manager-conf.j2
@@ -1,9 +1,9 @@
[DEFAULTS]
api_server_ip = {{ contrail_haproxy_address }}
api_server_port = 8082
-zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:2181{% if not loop.last %}, {% endif %}{% endfor %}
+zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:2181{% if not loop.last %}, {% endif %}{% endfor %}
-cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
disc_server_ip = {{ contrail_haproxy_address }}
disc_server_port = 5998
diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-discovery-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-discovery-conf.j2
index 6abcb590..509b3569 100755
--- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-discovery-conf.j2
+++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-discovery-conf.j2
@@ -1,10 +1,10 @@
[DEFAULTS]
-listen_ip_addr = 0.0.0.0
+listen_ip_addr = {{ contrail_haproxy_address }}
listen_port = 5998
-zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}{% if not loop.last %}, {% endif %}{% endfor %}
+zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}{% if not loop.last %}, {% endif %}{% endfor %}
zk_server_port = 2181
-cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
log_file = /var/log/contrail/contrail-discovery.log
log_level = SYS_NOTICE
diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-dns-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-dns-conf.j2
index 0a2ab433..9d415563 100755
--- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-dns-conf.j2
+++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-dns-conf.j2
@@ -1,6 +1,6 @@
[DEFAULT]
hostip = {{ contrail_address }}
-hostname = {{ ansible_hostname }}
+hostname = {{ inventory_hostname }}
log_file = /var/log/contrail/contrail-dns.log
log_level = SYS_NOTICE
log_local = 1
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 a9f7c281..7564d26d 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,8 +1,9 @@
[DEFAULT]
hostip = {{ contrail_address }}
-cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+#cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
-collectors = {{ contrail_address }}:8086
+collectors = {{ contrail_haproxy_address }}:8086
http_server_port = 8091
log_file = /var/log/contrail/contrail-query-engine.log
log_level = SYS_NOTICE
diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-schema-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-schema-conf.j2
index f394948d..cf5dead3 100755
--- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-schema-conf.j2
+++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-schema-conf.j2
@@ -1,13 +1,15 @@
[DEFAULTS]
-ifmap_server_ip = {{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }}
+#ifmap_server_ip = {{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }}
+ifmap_server_ip = {{ haproxy_hosts.values()[0] }}
ifmap_server_port = 8443
ifmap_username = schema-transformer
ifmap_password = schema-transformer
-api_server_ip = {{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }}
+#api_server_ip = {{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }}
+api_server_ip = {{ haproxy_hosts.values()[0] }}
api_server_port = 8082
-zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:2181{% if not loop.last %}, {% endif %}{% endfor %}
+zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:2181{% if not loop.last %}, {% endif %}{% endfor %}
-cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
disc_server_ip = {{ contrail_haproxy_address }}
disc_server_port = 5998
diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-svc-monitor-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-svc-monitor-conf.j2
index 070a60c3..6ad5ec2d 100755
--- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-svc-monitor-conf.j2
+++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-svc-monitor-conf.j2
@@ -1,13 +1,13 @@
[DEFAULTS]
-ifmap_server_ip = {{ contrail_address }}
+ifmap_server_ip = {{ contrail_haproxy_address }}
ifmap_server_port = 8443
ifmap_username = svc-monitor
ifmap_password = svc-monitor
api_server_ip = {{ contrail_haproxy_address }}
api_server_port = 8082
-zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:2181{% if not loop.last %}, {% endif %}{% endfor %}
+zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:2181{% if not loop.last %}, {% endif %}{% endfor %}
-cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
disc_server_ip = {{ contrail_haproxy_address }}
disc_server_port = 5998
diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-tor-agent-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-tor-agent-conf.j2
index fb483c3e..8d336e52 100755
--- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-tor-agent-conf.j2
+++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-tor-agent-conf.j2
@@ -78,7 +78,7 @@ server = {{ contrail_haproxy_address }}
[NETWORKS]
# control-channel IP address used by WEB-UI to connect to vnswad to fetch
# required information (Optional)
-control_network_ip = {{ contrail_address }}
+control_network_ip = {{ contrail_haproxy_address }}
[TOR]
# IP address of the TOR to manage
diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/haproxy-contrail-cfg.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/haproxy-contrail-cfg.j2
index e99917bd..d7691b6b 100755
--- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/haproxy-contrail-cfg.j2
+++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/haproxy-contrail-cfg.j2
@@ -1,57 +1,78 @@
#contrail-marker-start
listen contrail-stats
- bind *:5937
+# bind *:5937
+ bind {{ internal_vip.ip }}:5937
+ bind {{ public_vip.ip }}:5937
mode http
stats enable
stats uri /
stats auth haproxy:contrail123
-listen neutron-server
- bind *:9696
- balance roundrobin
- option nolinger
-{% for cur_host in groups['opencontrail_config'] %} server {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }} {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9697 check inter 2000 rise 2 fall 3
-{% endfor %}
+# compass has bind neutron-server
+#listen neutron-server
+# bind *:9696
+# balance roundrobin
+# option nolinger
+#{% for host,ip in haproxy_hosts.items() %}
+# server {{ host }} {{ ip }}:9697 weight 1 check inter 2000 rise 2 fall 3
+#{% endfor %}
+
+
listen contrail-api
- bind *:8082
+# bind *:8082
+ bind {{ internal_vip.ip }}:8082
+ bind {{ public_vip.ip }}:8082
balance roundrobin
option nolinger
timeout client 3m
timeout server 3m
-{% for cur_host in groups['opencontrail_config'] %} server {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }} {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9100 check inter 2000 rise 2 fall 3
+{% for host,ip in haproxy_hosts.items() %}
+ server {{ host }} {{ ip }}:9100 weight 1 check inter 2000 rise 2 fall 3
{% endfor %}
+
+
listen contrail-discovery
- bind *:5998
+# bind *:5998
+ bind {{ internal_vip.ip }}:5998
+ bind {{ public_vip.ip }}:5998
balance roundrobin
option nolinger
-{% for cur_host in groups['opencontrail_config'] %} server {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }} {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9110 check inter 2000 rise 2 fall 3
+{% for host,ip in haproxy_hosts.items() %}
+ server {{ host }} {{ ip }}:9110 weight 1 check inter 2000 rise 2 fall 3
{% endfor %}
+
+
listen contrail-analytics-api
- bind *:8081
+# bind *:8081
+ bind {{ internal_vip.ip }}:8081
+ bind {{ public_vip.ip }}:8081
balance roundrobin
option nolinger
option tcp-check
tcp-check connect port 6379
default-server error-limit 1 on-error mark-down
-{% for cur_host in groups['opencontrail_collector'] %} server {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }} {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9081 check inter 2000 rise 2 fall 3
+{% for host,ip in haproxy_hosts.items() %}
+ server {{ host }} {{ ip }}:9081 weight 1 check inter 2000 rise 2 fall 5
{% endfor %}
-listen rabbitmq
- bind *:5673
- mode tcp
- balance roundrobin
- maxconn 10000
- option tcplog
- option tcpka
- option redispatch
- timeout client 48h
- timeout server 48h
-{% for cur_host in groups['opencontrail_config'] %} server {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }} {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:5672 check inter 2000 rise 2 fall 3 weight 1 maxconn 500
+# compass doesn't use ha for rabbitmq, but use cluster mode
+#listen rabbitmq
+# bind *:5673
+# mode tcp
+# balance roundrobin
+# maxconn 10000
+# option tcplog
+# option tcpka
+# option redispatch
+# timeout client 48h
+# timeout server 48h
+{% for host,ip in haproxy_hosts.items() %}
+ server {{ host }} {{ ip }}:5672 weight 1 check inter 2000 rise 2 fall 5
{% endfor %}
#contrail-marker-end
diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-env-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-env-conf.j2
index 1b3e60f7..6728eddb 100755
--- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-env-conf.j2
+++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-env-conf.j2
@@ -1,2 +1,2 @@
NODE_IP_ADDRESS={{ contrail_address }}
-NODENAME=rabbit@{{ ansible_hostname }}-ctrl
+NODENAME=rabbit@{{ inventory_hostname }}-ctrl
diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/vrouter-nodemgr-param.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/vrouter-nodemgr-param.j2
index a4e35d67..c81b07db 100755
--- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/vrouter-nodemgr-param.j2
+++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/vrouter-nodemgr-param.j2
@@ -1 +1,2 @@
-DISCOVERY={{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }} \ No newline at end of file
+#DISCOVERY={{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }}
+DISCOVERY={{ haproxy_hosts.value()[0] }}
diff --git a/deploy/adapters/ansible/roles/open-contrail/vars/main.yml b/deploy/adapters/ansible/roles/open-contrail/vars/main.yml
index 22b3c826..0f47bd77 100755
--- a/deploy/adapters/ansible/roles/open-contrail/vars/main.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/vars/main.yml
@@ -5,8 +5,19 @@ kernel_install: no
#ansible_ssh_pass: "root"
contrail_keystone_address: "{{ internal_vip.ip }}"
-contrail_admin_user: "keystone"
-contrail_admin_password: "service"
+contrail_admin_user: "admin"
+contrail_admin_password: "console"
+
+
+# network infor adapter for compass
+contrail_device: "mgmt"
+contrail_address: "{{ internal_ip }}"
+contrail_netmask: "255.255.255.0"
+#contrail_gateway: "10.84.50.254"
+contrail_gateway:
+#contrail_mgmt_address: "172.27.113.91"
+
+
contrail_keepalived: no
#contrail_haproxy_address: "10.0.0.22" # 10.0.0.80
@@ -20,7 +31,7 @@ contrail_router_asn: "64512"
### Modify when need openstack provisioning
keystone_provision: no
install_nova: no
-rabbit_password: "password"
+rabbit_password: "console"
contrail_tor_agents:
- name: "test01"