aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/open-contrail
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/adapters/ansible/roles/open-contrail')
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml6
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml20
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml12
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml8
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml8
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml6
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml7
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml6
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/main.yml13
-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-add-nodes.yml2
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-collector.yml8
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml40
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml35
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml10
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-database.yml39
-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-tsn.yml2
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml6
-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.j278
-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.j22
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/vars/Debian.yml22
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/vars/main.yml28
35 files changed, 258 insertions, 186 deletions
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 02bc7f81..ba6ccbc8 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
@@ -6,11 +6,11 @@
- name: "temporary disable supervisor analytics"
template:
# src: "templates/override.j2"
- src: "install/override.j2"
+ src: "../../templates/install/override.j2"
dest: "/etc/init/supervisor-analytics.override"
- name: "install contrail openstack analytics package"
# apt:
# name: "contrail-openstack-analytics"
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
- with_items: collector_packages
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
+ with_items: collector_package
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 ea08e49b..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
@@ -2,16 +2,25 @@
#- hosts: all
# sudo: yes
# tasks:
-- name: "copy contrail install package temporary"
+#- name: "copy contrail install package temporary"
# sudo: True
- copy:
- src: "files/{{ package }}"
- dest: "/tmp/{{ package }}"
+# copy:
+# src: "{{ package }}"
+# dest: "/tmp/{{ package }}"
+
+- name: get image http server
+ shell: awk -F'=' '/compass_server/ {print $2}' /etc/compass.conf
+ register: http_server
+
+- name: download OpenContrail package file
+ get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/open-contrail/{{ package }}" dest=/tmp/{{ package }}
+
- name: "install contrail install package"
# sudo: True
apt:
deb: "/tmp/{{ package }}"
+ force: yes
- name: "delete temporary contrail install package"
# sudo: True
@@ -48,7 +57,9 @@
# sudo: True
apt:
deb: "{{ item }}"
+ force: yes
with_items: required_packages.stdout_lines
+ ignore_errors: True
- name: modify source list
# sudo: True
@@ -82,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 12b6ad28..d7f5c38b 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
@@ -5,7 +5,7 @@
- name: "temporary disable supervisor vrouter"
# sudo: True
template:
- src: "install/override.j2"
+ src: "../../templates/install/override.j2"
dest: "/etc/init/supervisor-vrouter.override"
# - name: "install nova-compute for contrail package"
@@ -18,8 +18,8 @@
# 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"
- with_items: vrouter_packages
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
+ with_items: vrouter_package
when: ansible_kernel == kernel_required
- name: "install contrail vrouter dkms package"
@@ -27,8 +27,8 @@
# name: "contrail-vrouter-dkms"
# when: ansible_kernel != "3.13.0-40-generic"
# sudo: True
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
- with_items: dkms_packages
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
+ with_items: dkms_package
when: ansible_kernel != kernel_required
# - name: "install contrail vrouter common package"
@@ -42,6 +42,6 @@
- name: "install contrail vrouter common & nova vif package"
# sudo: True
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
- with_items: compute_packages | union(compute_packages_noarch)
+ with_items: compute_package | union(compute_package_noarch)
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 52459eb8..dbd542be 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
@@ -6,19 +6,19 @@
# sudo: True
template:
# src: "templates/override.j2"
- src: "install/override.j2"
+ src: "../../templates/install/override.j2"
dest: "/etc/init/supervisor-config.override"
- name: "temporary disable neutron server"
# sudo: True
template:
# src: "templates/override.j2"
- src: "install/override.j2"
+ src: "../../templates/install/override.j2"
dest: "/etc/init/neutron-server.override"
- name: "install contrail openstack config package"
# sudo: True
# apt:
# name: "contrail-openstack-config"
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
- with_items: config_packages
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
+ with_items: config_package
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 6bb7fb25..51a713ec 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
@@ -6,19 +6,19 @@
# sudo: True
template:
# src: "templates/override.j2"
- src: "install/override.j2"
+ src: "../../templates/install/override.j2"
dest: "/etc/init/supervisor-control.override"
- name: "temporary disable supervisor dns"
# sudo: True
template:
# src: "templates/override.j2"
- src: "install/override.j2"
+ src: "../../templates/install/override.j2"
dest: "/etc/init/supervisor-dns.override"
- name: "install contrail openstack control package"
# sudo: True
# apt:
# name: "contrail-openstack-control"
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
- with_items: control_packages
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
+ with_items: control_package
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 fea4cef7..5b4875a7 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
@@ -6,12 +6,12 @@
# sudo: True
template:
# src: "templates/override.j2"
- src: "install/override.j2"
+ src: "../../templates/install/override.j2"
dest: "/etc/init/supervisor-database.override"
- name: "install contrail openstack database package"
# sudo: True
# apt:
# name: "contrail-openstack-database"
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
- with_items: database_packages
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
+ with_items: database_package
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 6d4ca035..ed638b6a 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
@@ -2,6 +2,7 @@
#- hosts: all
# sudo: yes
# tasks:
+
- name: "install Ubuntu kernel"
# sudo: True
# apt:
@@ -10,8 +11,8 @@
# 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"
- with_items: kernel_packages | union(kernel_packages_noarch)
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
+ with_items: kernel_package | union(kernel_package_noarch)
when: (kernel_install) and (ansible_kernel != kernel_required)
- name: "setup grub"
@@ -39,7 +40,7 @@
# when: (kernel_install) and (ansible_kernel != "3.13.0-40-generic")
when: (kernel_install) and (ansible_kernel != kernel_required)
-handlers:
+# handlers:
- name: "Wait for server to come back"
local_action:
module: wait_for
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 d66af675..665f2be2 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
@@ -7,12 +7,12 @@
# sudo: True
template:
# src: "templates/override.j2"
- src: "install/override.j2"
+ src: "../../templates/install/override.j2"
dest: "/etc/init/supervisor-webui.override"
- name: "install contrail openstack webui package"
# sudo: True
# apt:
# name: "contrail-openstack-webui"
- action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
- with_items: webui_packages
+ action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes"
+ with_items: webui_package
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml
index 2a0e2709..93f22117 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml
@@ -33,7 +33,8 @@
- name: Install compute for Open Contrail
include: install/install-compute.yml
- when: inventory_hostname in groups['opencontrail_compute'] or inventory_hostname in groups['opencontrail_tsn']
+ when: inventory_hostname in groups['opencontrail_compute']
+# or inventory_hostname in groups['opencontrail_tsn']
# Compass adapter: use OpenStack management network "mgmt"
@@ -52,9 +53,9 @@
#- include: install/install-interface.yml
-- name: Provision route on all hosts for Open Contrail
- include: provision/provision-route.yml
- when: groups['opencontrail_control']|length !=0
+#- name: Provision route on all hosts for Open Contrail
+# include: provision/provision-route.yml
+# when: groups['opencontrail_control']|length !=0
#- name: Provision rabbitmq on config for Open Contrail
@@ -64,7 +65,8 @@
- name: Provision increase limits for Open Contrail
include: provision/provision-increase-limits.yml
- when: inventory_hostname in groups['opencontrail_control'] or inventory_hostname in groups['opencontrail_config'] or inventory_hostname in groups['opencontrail_collector'] or inventory_hostname in groups['opencontrail_database']
+ when: inventory_hostname in groups['opencontrail_control']
+#or inventory_hostname in groups['opencontrail_config'] or inventory_hostname in groups['opencontrail_collector'] or inventory_hostname in groups['opencontrail_database']
- name: Provision database for Open Contrail
@@ -76,7 +78,6 @@
include: provision/provision-config.yml
when: inventory_hostname in groups['opencontrail_config']
-
- name: Provision control for Open Contrail
include: provision/provision-control.yml
when: inventory_hostname in groups['opencontrail_control']
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-add-nodes.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-add-nodes.yml
index f4ad05cb..b8c07ddd 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-add-nodes.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-add-nodes.yml
@@ -44,4 +44,4 @@
shell: "python /opt/contrail/utils/provision_encap.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --oper add --encap_priority MPLSoUDP,MPLSoGRE,VXLAN"
run_once: yes
when: inventory_hostname in groups['opencontrail_config']
- \ No newline at end of file
+
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 5dd72d77..4077ba64 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
@@ -19,19 +19,19 @@
- name: "fix up contrail collector config"
template:
- src: "provision/contrail-collector-conf.j2"
+ src: "../../templates/provision/contrail-collector-conf.j2"
dest: "/etc/contrail/contrail-collector.conf"
- name: "fix up contrail query engine config"
template:
- src: "provision/contrail-query-engine-conf.j2"
+ src: "../../templates/provision/contrail-query-engine-conf.j2"
dest: "/etc/contrail/contrail-query-engine.conf"
- name: "fix up contrail analytics api config"
template:
- src: "provision/contrail-analytics-api-conf.j2"
+ src: "../../templates/provision/contrail-analytics-api-conf.j2"
dest: "/etc/contrail/contrail-analytics-api.conf"
@@ -45,7 +45,7 @@
- name: "fix up contrail keystone auth config"
template:
- src: "provision/contrail-keystone-auth-conf.j2"
+ src: "../../templates/provision/contrail-keystone-auth-conf.j2"
dest: "/etc/contrail/contrail-keystone-auth.conf"
force: no
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 41ea5c25..3e3d6622 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
@@ -17,7 +17,7 @@
- name: "create cgroup device acl for qemu conf"
template:
- src: "provision/qemu-device-acl-conf.j2"
+ src: "../../templates/provision/qemu-device-acl-conf.j2"
dest: "/tmp/qemu-device-acl.conf"
when: deviceacl | failed
@@ -33,7 +33,7 @@
- name: "fix up vrouter nodemgr param"
template:
- src: "provision/vrouter-nodemgr-param.j2"
+ src: "../../templates/provision/vrouter-nodemgr-param.j2"
dest: "/etc/contrail/vrouter_nodemgr_param"
- name: "set contrail device name for ansible"
@@ -42,7 +42,7 @@
- name: "fix up default pmac"
template:
- src: "provision/default-pmac.j2"
+ src: "../../templates/provision/default-pmac.j2"
dest: "/etc/contrail/default_pmac"
- name: "copy agent param config from template"
@@ -56,7 +56,7 @@
- name: "fix up contrail vrouter agent config"
template:
- src: "provision/contrail-vrouter-agent-conf.j2"
+ src: "../../templates/provision/contrail-vrouter-agent-conf.j2"
dest: "/etc/contrail/contrail-vrouter-agent.conf"
- name: "delete lines for contrail interface"
@@ -77,22 +77,22 @@
- "sed -i -n -e '/auto .*/,$p' /tmp/contrail-interfaces-bottom"
- "cat /tmp/contrail-interfaces-top /tmp/contrail-interfaces-bottom > /etc/network/interfaces"
-- name: "configure interface"
- lineinfile:
- dest: "/etc/network/interfaces"
- line: "{{ item }}"
- state: "present"
- with_items:
- - "auto {{ contrail_device }}"
- - "iface {{ contrail_device }} inet manual"
- - "\tpre-up ifconfig {{ contrail_device }} up"
- - "\tpost-down ifconfig {{ contrail_device }} down"
- - "auto vhost0"
- - "iface vhost0 inet static"
- - "\tpre-up /opt/contrail/bin/if-vhost0"
- - "\tnetwork_name application"
- - "\taddress {{ contrail_address }}"
- - "\tnetmask {{ contrail_netmask }}"
+#- name: "configure interface"
+# lineinfile:
+# dest: "/etc/network/interfaces"
+# line: "{{ item }}"
+# state: "present"
+# with_items:
+# - "auto {{ contrail_device }}"
+# - "iface {{ contrail_device }} inet manual"
+# - "\tpre-up ifconfig {{ contrail_device }} up"
+# - "\tpost-down ifconfig {{ contrail_device }} down"
+# - "auto vhost0"
+# - "iface vhost0 inet static"
+# - "\tpre-up /opt/contrail/bin/if-vhost0"
+# - "\tnetwork_name application"
+# - "\taddress {{ contrail_address }}"
+# - "\tnetmask {{ contrail_netmask }}"
- name: "delete temporary files"
file:
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml
index 8aa8f43b..cef5bbff 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml
@@ -35,7 +35,8 @@
- name: "create haproxy configuration for contrail"
template:
- src: "provision/haproxy-contrail-cfg.j2"
+# src: "provision/haproxy-contrail-cfg.j2"
+ src: "../../templates/provision/haproxy-contrail-cfg.j2"
dest: "/tmp/haproxy-contrail.cfg"
- name: "combination of the haproxy configuration"
@@ -54,7 +55,7 @@
# Compass is using this
#- name: "create keepalived configuration"
# template:
-# src: "provision/keepalived-conf.j2"
+# src: "../../templates/provision/keepalived-conf.j2"
# dest: "/etc/keepalived/keepalived.conf"
# with_indexed_items: groups['opencontrail_config']
# when: contrail_keepalived and item.1 == inventory_hostname
@@ -70,37 +71,37 @@
- name: "fix up contrail keystone auth config"
template:
- src: "provision/contrail-keystone-auth-conf.j2"
+ src: "../../templates/provision/contrail-keystone-auth-conf.j2"
dest: "/etc/contrail/contrail-keystone-auth.conf"
- name: "fix up ifmap server log4j properties"
template:
- src: "provision/ifmap-log4j-properties.j2"
+ src: "../../templates/provision/ifmap-log4j-properties.j2"
dest: "/etc/ifmap-server/log4j.properties"
- name: "fix up ifmap server authorization properties"
template:
- src: "provision/ifmap-authorization-properties.j2"
+ src: "../../templates/provision/ifmap-authorization-properties.j2"
dest: "/etc/ifmap-server/authorization.properties"
- name: "fix up ifmap server basicauthusers properties"
template:
- src: "provision/ifmap-basicauthusers-properties.j2"
+ src: "../../templates/provision/ifmap-basicauthusers-properties.j2"
dest: "/etc/ifmap-server/basicauthusers.properties"
- name: "fix up ifmap server publisher properties"
template:
- src: "provision/ifmap-publisher-properties.j2"
+ src: "../../templates/provision/ifmap-publisher-properties.j2"
dest: "/etc/ifmap-server/publisher.properties"
- name: "fix up contrail api config"
template:
- src: "provision/contrail-api-conf.j2"
+ src: "../../templates/provision/contrail-api-conf.j2"
dest: "/etc/contrail/contrail-api.conf"
- name: "fix up contrail api supervisord config"
template:
- src: "provision/contrail-api-supervisord-conf.j2"
+ src: "../../templates/provision/contrail-api-supervisord-conf.j2"
dest: "/etc/contrail/supervisord_config_files/contrail-api.ini"
- name: "modify contrail api init script"
@@ -111,27 +112,27 @@
- name: "fix up contrail schema config"
template:
- src: "provision/contrail-schema-conf.j2"
+ src: "../../templates/provision/contrail-schema-conf.j2"
dest: "/etc/contrail/contrail-schema.conf"
- name: "fix up contrail device manager config"
template:
- src: "provision/contrail-device-manager-conf.j2"
+ src: "../../templates/provision/contrail-device-manager-conf.j2"
dest: "/etc/contrail/contrail-device-manager.conf"
- name: "fix up contrail svc monitor config"
template:
- src: "provision/contrail-svc-monitor-conf.j2"
+ src: "../../templates/provision/contrail-svc-monitor-conf.j2"
dest: "/etc/contrail/contrail-svc-monitor.conf"
- name: "fix up contrail discovery supervisord config"
template:
- src: "provision/contrail-discovery-supervisord-conf.j2"
+ src: "../../templates/provision/contrail-discovery-supervisord-conf.j2"
dest: "/etc/contrail/supervisord_config_files/contrail-discovery.ini"
- name: "fix up contrail discovery config"
template:
- src: "provision/contrail-discovery-conf.j2"
+ src: "../../templates/provision/contrail-discovery-conf.j2"
dest: "/etc/contrail/contrail-discovery.conf"
- name: "modify contrail discovery init script"
@@ -142,7 +143,7 @@
- name: "fix up contrail vnc api library config"
template:
- src: "provision/contrail-vnc-api-lib-ini.j2"
+ src: "../../templates/provision/contrail-vnc-api-lib-ini.j2"
dest: "/etc/contrail/vnc_api_lib.ini"
- name: "fix up contrail config nodemgr config"
@@ -154,7 +155,7 @@
- name: "fix up contrail sudoers"
template:
- src: "provision/contrail-sudoers.j2"
+ src: "../../templates/provision/contrail-sudoers.j2"
dest: "/etc/sudoers.d/contrail_sudoers"
mode: 0440
@@ -165,7 +166,7 @@
- name: "fix up contrail plugin for nuetron"
template:
- src: "provision/neutron-contrail-plugin-ini.j2"
+ src: "../../templates/provision/neutron-contrail-plugin-ini.j2"
dest: "/etc/neutron/plugins/opencontrail/ContrailPlugin.ini"
- name: "modify neutron server configuration"
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 e36d8f22..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
@@ -15,13 +15,15 @@
- name: "modify ifmap server basicauthusers properties for control"
lineinfile:
dest: "/etc/ifmap-server/basicauthusers.properties"
- line: "{{ hostvars[item]['contrail_address' ] }}:{{ hostvars[item]['contrail_address' ] }}"
+# line: "{{ hostvars[item]['contrail_address' ] }}:{{ hostvars[item]['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: "{{ hostvars[item]['contrail_address' ] }}.dns:{{ hostvars[item]['contrail_address' ] }}.dns"
+ line: "{{ haproxy_hosts[item] }}.dns:{{ haproxy_hosts[item] }}.dns"
with_items: groups['opencontrail_control']
- name: "node-common"
@@ -29,12 +31,12 @@
- name: "fix up contrail control config"
template:
- src: "provision/contrail-control-conf.j2"
+ src: "../../templates/provision/contrail-control-conf.j2"
dest: "/etc/contrail/contrail-control.conf"
- name: "fix up contrail dns config"
template:
- src: "provision/contrail-dns-conf.j2"
+ src: "../../templates/provision/contrail-dns-conf.j2"
dest: "/etc/contrail/contrail-dns.conf"
- name: "fix up contrail control nodemgr config"
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 6807d7d4..b20491b5 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
@@ -46,19 +48,25 @@
- { regexp: "^(#(\\s*)?)?initial_token:", line: "# initial_token:" }
+
- name: "set first database host seed"
# sudo: True
set_fact:
- dbseeds: "{{ hostvars[item.1]['contrail_address'] }}"
- with_indexed_items: groups['database']
+# dbseeds: "{{ hostvars[item.1][ contrail_address ] }}"
+ dbseeds: "{{ haproxy_hosts[item.1] }}"
+ 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'] }}"
- with_indexed_items: groups['database']
+# dbseeds: "{{ dbseeds }},{{ hostvars[item.1]['contrail_address'] }}"
+ dbseeds: "{{ dbseeds }},{{ haproxy_hosts[item.1] }}"
+ with_indexed_items: groups['opencontrail_database']
when: item.0 == 1
@@ -112,16 +120,17 @@
lineinfile:
dest: "/etc/zookeeper/conf/zoo.cfg"
regexp: "server.{{ item.0 + 1 }}="
- line: "server.{{ item.0 + 1 }}={{ hostvars[item.1]['contrail_address'] }}:2888:3888"
- with_indexed_items: groups['database']
+# line: "server.{{ item.0 + 1 }}={{ hostvars[item.1]['contrail_address'] }}:2888:3888"
+ line: "server.{{ item.0 + 1 }}={{ haproxy_hosts[item.1] }}:2888:3888"
+ with_indexed_items: groups['opencontrail_database']
- name: "set zookeeper unique id"
# sudo: True
template:
- src: "templates/zookeeper-unique-id.j2"
+ src: "../../templates/provision/zookeeper-unique-id.j2"
dest: "/var/lib/zookeeper/myid"
- with_indexed_items: groups['database']
+ with_indexed_items: groups['opencontrail_database']
when: item.1 == inventory_hostname
@@ -135,16 +144,18 @@
- name: "set first zookeeper host address"
# sudo: True
set_fact:
- zkaddrs: "{{ hostvars[item.1]['contrail_address'] }}:2181"
- with_indexed_items: groups['database']
+# zkaddrs: "{{ hostvars[item.1]['contrail_address'] }}:2181"
+ zkaddrs: "{{ haproxy_hosts[item.1] }}: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"
- with_indexed_items: groups['database']
+# zkaddrs: "{{ zkaddrs }},{{ hostvars[item.1]['contrail_address'] }}:2181"
+ zkaddrs: "{{ zkaddrs }},{{ haproxy_hosts[item.1] }}: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-tsn.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-tsn.yml
index 058be18a..33ad6507 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-tsn.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-tsn.yml
@@ -39,7 +39,7 @@
- name: "fix up contrail vrouter agent config"
template:
- src: "provision/contrail-vrouter-agent-conf.j2"
+ src: "../../templates/provision/contrail-vrouter-agent-conf.j2"
dest: "/etc/contrail/contrail-vrouter-agent.conf"
- name: "delete lines for contrail interface"
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 eb6301b2..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
@@ -16,13 +16,15 @@
- name: "set first cassandra host address"
set_fact:
- cassandra_addrs: "'{{ hostvars[item.1]['contrail_address'] }}'"
+# cassandra_addrs: "'{{ hostvars[item.1]['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 }}, '{{ hostvars[item.1]['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 18192f19..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'] %}{{ hostvars[cur_host]['contrail_address'] }}: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 1eefacfb..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]['contrail_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]['contrail_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 e6242346..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'] %}{{ hostvars[cur_host]['contrail_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 %}
# 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 77bcc95f..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]['contrail_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]['contrail_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 84e6317f..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]['contrail_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]['contrail_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 e051b7ec..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'] %}{{ hostvars[cur_host]['contrail_address'] }}: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 2bb4ab79..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 = {{ hostvars[groups['opencontrail_config'][0]]['contrail_address'] }}
+#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 = {{ hostvars[groups['opencontrail_config'][0]]['contrail_address'] }}
+#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]['contrail_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]['contrail_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 4b4221d7..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]['contrail_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]['contrail_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 6aa4d06e..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,66 +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]['contrail_address'] }} {{ hostvars[cur_host]['contrail_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]['contrail_address'] }} {{ hostvars[cur_host]['contrail_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]['contrail_address'] }} {{ hostvars[cur_host]['contrail_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]['contrail_address'] }} {{ hostvars[cur_host]['contrail_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 %}
-{% if contrail_tor_agents is defined %}listen contrail-tor-agent
- bind {% for cur_agent in contrail_tor_agents %}*:{{ cur_agent['ovs_port'] }}{% if not loop.last %},{% endif %}{% endfor %}
- mode tcp
- balance leastconn
- option tcplog
- option tcpka
-{% for cur_host in groups['opencontrail_tsn'] %} server {{ hostvars[cur_host]['contrail_address'] }} {{ hostvars[cur_host]['contrail_address'] }} check inter 2000
-{% endfor %}{% endif %}
-
-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]['contrail_address'] }} {{ hostvars[cur_host]['contrail_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 7eee51ba..436967b7 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 @@
-DISCOVERY={{ hostvars[groups['opencontrail_config'][0]]['contrail_address'] }}
+DISCOVERY={{ haproxy_hosts.values()[0] }}
diff --git a/deploy/adapters/ansible/roles/open-contrail/vars/Debian.yml b/deploy/adapters/ansible/roles/open-contrail/vars/Debian.yml
index c64f238f..62596917 100755
--- a/deploy/adapters/ansible/roles/open-contrail/vars/Debian.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/vars/Debian.yml
@@ -1,11 +1,11 @@
---
-package: "contrail-install-packages_2.21-102~juno_all.deb"
+package: "contrail-install-packages_2.21-102-ubuntu-14-04juno_all.deb"
-common_packages:
+common_package:
- contrail-setup
-kernel_packages:
+kernel_package:
- linux-headers-3.13.0-40
- linux-headers-3.13.0-40-generic
- linux-image-3.13.0-40-generic
@@ -13,28 +13,28 @@ kernel_packages:
kernel_required: "3.13.0-40-generic"
-database_packages:
+database_package:
- contrail-openstack-database
-config_packages:
+config_package:
- contrail-openstack-config
-control_packages:
+control_package:
- contrail-openstack-control
-collector_packages:
+collector_package:
- contrail-openstack-analytics
-webui_packages:
+webui_package:
- contrail-openstack-webui
-vrouter_packages:
+vrouter_package:
- contrail-vrouter-3.13.0-40-generic
-dkms_packages:
+dkms_package:
- contrail-vrouter-dkms
-compute_packages:
+compute_package:
- contrail-vrouter-common
- contrail-nova-vif
diff --git a/deploy/adapters/ansible/roles/open-contrail/vars/main.yml b/deploy/adapters/ansible/roles/open-contrail/vars/main.yml
index 015c99b7..e19b1fbf 100755
--- a/deploy/adapters/ansible/roles/open-contrail/vars/main.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/vars/main.yml
@@ -1,15 +1,27 @@
---
#package: "contrail-install-packages_2.21-102~juno_all.deb" # mv to {os}.yml
kernel_install: no
-ansible_ssh_user: "root"
-ansible_ssh_pass: "root"
+#ansible_ssh_user: "root"
+#ansible_ssh_pass: "root"
contrail_keystone_address: "{{ internal_vip.ip }}"
-contrail_admin_user: "keystone"
-contrail_admin_password: "{{ keystone_PASS }}"
+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
+#contrail_haproxy_address: "10.0.0.22" # 10.0.0.80
+contrail_haproxy_address: "{{ internal_vip.ip }}"
contrail_netmask: "255.255.255.0"
contrail_prefixlen: "24"
contrail_gateway: "10.0.0.1"
@@ -19,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"
@@ -43,9 +55,9 @@ contrail_tor_agents:
# adapter for compass
-kernel_packages_noarch: []
+kernel_package_noarch: []
-compute_packages_noarch: []
+compute_package_noarch: []
# network infor adapter for compass
contrail_device: "mgmt"