summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/open-contrail/tasks
diff options
context:
space:
mode:
authorchenshuai@huawei.com <chenshuai@huawei.com>2015-12-08 20:08:46 +0800
committerchenshuai@huawei.com <chenshuai@huawei.com>2015-12-08 20:11:12 +0800
commite408668e84f138f69317ff63e68b823dfe80188b (patch)
tree3279a6cd251f051265d653fa487eaec0c5d3e4b6 /deploy/adapters/ansible/roles/open-contrail/tasks
parent4d32ee565ecd829a2ec767cae6d8cd23df8e6263 (diff)
OpenContrail Script Adapter
JIRA: COMPASS-186 Change-Id: I792bc1b592348c9bcc21d6e3616d7b0b79d13f25 Signed-off-by: chenshuai@huawei.com <chenshuai@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/open-contrail/tasks')
-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.yml17
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml2
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml4
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml4
-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.yml3
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml2
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/main.yml13
-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.yml33
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml6
16 files changed, 104 insertions, 79 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..5dbf9244 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,7 +6,7 @@
- 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"
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..3a57fdf0 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,11 +2,19 @@
#- 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
@@ -49,6 +57,7 @@
apt:
deb: "{{ item }}"
with_items: required_packages.stdout_lines
+ ignore_errors: True
- name: modify source list
# sudo: True
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..6c85ce55 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"
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..1d493f58 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,14 +6,14 @@
# 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"
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..7e917d16 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,14 +6,14 @@
# 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"
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..68c5946b 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,7 +6,7 @@
# 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"
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..8b0e3347 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:
@@ -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..22156ca3 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,7 +7,7 @@
# 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"
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/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..1a5ddf7b 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: "{{ contrail_address }}:{{ contrail_address }}"
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: "{{ contrail_address }}.dns:{{ contrail_address }}.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..f95e7feb 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
@@ -46,19 +46,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: "{{ contrail_address }}"
+ 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 }},{{ contrail_address }}"
+ with_indexed_items: groups['opencontrail_database']
when: item.0 == 1
@@ -112,16 +118,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 }}={{ contrail_address }}: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 +142,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: "{{ contrail_address }}: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 }},{{ contrail_address }}:2181"
+ with_indexed_items: groups['opencontrail_database']
when: item.0 > 0
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..1090ddaa 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: "'{{ contrail_address }}'"
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 }}, '{{ contrail_address }}'"
with_indexed_items: groups['opencontrail_database']
when: item.0 > 0