aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/open-contrail/tasks/provision
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/adapters/ansible/roles/open-contrail/tasks/provision
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/adapters/ansible/roles/open-contrail/tasks/provision')
-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
6 files changed, 36 insertions, 21 deletions
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