From 55baaadf3ee21bf5769ee791533b66d28f9455ef Mon Sep 17 00:00:00 2001 From: "chenshuai@huawei.com" Date: Tue, 29 Dec 2015 17:27:25 +0800 Subject: bugfix: opencontrail add force parameter for apt-get install JIRA: COMPASS-227 Change-Id: I4e9ae9dfed29f6d58c9200d21f09cf2a71961ca1 Signed-off-by: chenshuai@huawei.com --- .../tasks/install/install-collector.yml | 2 +- .../open-contrail/tasks/install/install-common.yml | 3 +++ .../tasks/install/install-compute.yml | 4 ++-- .../open-contrail/tasks/install/install-config.yml | 2 +- .../tasks/install/install-control.yml | 2 +- .../tasks/install/install-database.yml | 2 +- .../open-contrail/tasks/install/install-kernel.yml | 2 +- .../open-contrail/tasks/install/install-webui.yml | 2 +- .../tasks/provision/-vrouter-compute-setup.yml | 26 ++++++++++++++++------ .../tasks/provision/provision-control.yml | 4 ++-- .../tasks/provision/provision-database.yml | 16 +++++++------ .../tasks/provision/provision-rabbitmq.yml | 3 ++- .../tasks/provision/provision-toragent.yml | 4 ++-- .../tasks/provision/provision-webui.yml | 4 ++-- 14 files changed, 47 insertions(+), 29 deletions(-) (limited to 'deploy/adapters/ansible/roles/open-contrail/tasks') diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml index 5dbf9244..cac370e4 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml @@ -12,5 +12,5 @@ - name: "install contrail openstack analytics package" # apt: # name: "contrail-openstack-analytics" - action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" + action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes" with_items: collector_packages diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml index 3a57fdf0..e963e160 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml @@ -20,6 +20,7 @@ # sudo: True apt: deb: "/tmp/{{ package }}" + force: yes - name: "delete temporary contrail install package" # sudo: True @@ -56,6 +57,7 @@ # sudo: True apt: deb: "{{ item }}" + force: yes with_items: required_packages.stdout_lines ignore_errors: True @@ -91,3 +93,4 @@ apt: name: "contrail-setup" update_cache: yes + force: yes diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml index 6c85ce55..3703522d 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml @@ -18,7 +18,7 @@ # name: "contrail-vrouter-3.13.0-40-generic" # when: ansible_kernel == "3.13.0-40-generic" # sudo: True - action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" + action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes" with_items: vrouter_packages when: ansible_kernel == kernel_required @@ -27,7 +27,7 @@ # name: "contrail-vrouter-dkms" # when: ansible_kernel != "3.13.0-40-generic" # sudo: True - action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" + action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes" with_items: dkms_packages when: ansible_kernel != kernel_required diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml index 1d493f58..e8d4f040 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml @@ -20,5 +20,5 @@ # sudo: True # apt: # name: "contrail-openstack-config" - action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" + action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes" with_items: config_packages diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml index 7e917d16..a1f53076 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml @@ -20,5 +20,5 @@ # sudo: True # apt: # name: "contrail-openstack-control" - action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" + action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes" with_items: control_packages diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml index 68c5946b..364fc8e3 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml @@ -13,5 +13,5 @@ # sudo: True # apt: # name: "contrail-openstack-database" - action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" + action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes" with_items: database_packages diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml index 8b0e3347..f1ccfede 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml @@ -11,7 +11,7 @@ # name: "linux-image-3.13.0-40-generic" # name: "linux-image-extra-3.13.0-40-generic" # when: (kernel_install) and (ansible_kernel != "3.13.0-40-generic") - action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" + action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes" with_items: kernel_packages | union(kernel_packages_noarch) when: (kernel_install) and (ansible_kernel != kernel_required) diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml index 22156ca3..727c4947 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml @@ -14,5 +14,5 @@ # sudo: True # apt: # name: "contrail-openstack-webui" - action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" + action: "{{ ansible_pkg_mgr }} name={{ item }} state=present force=yes" with_items: webui_packages diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/-vrouter-compute-setup.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/-vrouter-compute-setup.yml index 77ee20e3..f53e38ec 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/-vrouter-compute-setup.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/-vrouter-compute-setup.yml @@ -31,21 +31,21 @@ - { section: "DEFAULT", option: "auth_strategy", value: "keystone" } - { section: "DEFAULT", option: "libvirt_nonblocking", value: "True" } - { section: "DEFAULT", option: "libvirt_inject_partition", value: "-1" } - - { section: "DEFAULT", option: "rabbit_host", value: "{{ hostvars[groups['config'][0]]['contrail_address'] }}" } + - { section: "DEFAULT", option: "rabbit_host", value: "{{ contrail_haproxy_address }}" } - { section: "DEFAULT", option: "rabbit_port", value: "5672" } - - { section: "DEFAULT", option: "glance_host", value: "{{ hostvars[groups['openstack'][0]]['contrail_address'] }}" } + - { section: "DEFAULT", option: "glance_host", value: "{{ contrail_haproxy_address }}" } - { section: "DEFAULT", option: "glance_port", value: "9292" } - { section: "DEFAULT", option: "neutron_admin_tenant_name", value: "service" } - { section: "DEFAULT", option: "neutron_admin_username", value: "neutron" } - { section: "DEFAULT", option: "neutron_admin_password", value: "{{ contrail_admin_password }}" } - - { section: "DEFAULT", option: "neutron_admin_auth_url", value: "http://{{ hostvars[groups['openstack'][0]]['contrail_address'] }}:35357/v2.0/" } - - { section: "DEFAULT", option: "neutron_url", value: "http://{{ hostvars[groups['config'][0]]['contrail_address'] }}:9696/" } + - { section: "DEFAULT", option: "neutron_admin_auth_url", value: "http://{{ contrail_haproxy_address }}:35357/v2.0/" } + - { section: "DEFAULT", option: "neutron_url", value: "http://{{ contrail_haproxy_address }}:9696/" } - { section: "DEFAULT", option: "neutron_url_timeout", value: "300" } - { section: "DEFAULT", option: "network_api_class", value: "nova.network.neutronv2.api.API" } - { section: "DEFAULT", option: "compute_driver", value: "libvirt.LibvirtDriver" } - { section: "DEFAULT", option: "network_api_class", value: " nova_contrail_vif.contrailvif.ContrailNetworkAPI" } - { section: "DEFAULT", option: "ec2_private_dns_show_ip", value: "False" } - - { section: "DEFAULT", option: "novncproxy_base_url", value: "http://{{ hostvars[groups['openstack'][0]]['contrail_mgmt_address'] }}:5999/vnc_auto.html" } + - { section: "DEFAULT", option: "novncproxy_base_url", value: "http://{{ contrail_haproxy_address }}:5999/vnc_auto.html" } - { section: "DEFAULT", option: "vncserver_enabled", value: "True" } - { section: "DEFAULT", option: "vncserver_listen", value: "{{ contrail_address }}" } - { section: "DEFAULT", option: "vncserver_proxyclient_address", value: "{{ contrail_address }}" } @@ -54,16 +54,28 @@ - { section: "DEFAULT", option: "image_cache_manager_interval", value: "0" } - { section: "DEFAULT", option: "libvirt_cpu_mode", value: "none" } - { section: "DEFAULT", option: "libvirt_vif_driver", value: "nova_contrail_vif.contrailvif.VRouterVIFDriver" } - - { section: "database", option: "connection", value: "mysql://nova:nova@{{ hostvars[groups['openstack'][0]]['contrail_address'] }}/nova?charset=utf8" } + - { section: "database", option: "connection", value: "mysql://nova:nova@{{ contrail_haproxy_address }}/nova?charset=utf8" } - { section: "database", option: "idle_timeout", value: "180" } - { section: "database", option: "max_retries", value: "-1" } - { section: "keystone_authtoken", option: "admin_tenant_name", value: "service" } - { section: "keystone_authtoken", option: "admin_user", value: "nova" } - { section: "keystone_authtoken", option: "admin_password", value: "{{ contrail_admin_password }}" } - { section: "keystone_authtoken", option: "auth_protocol", value: "http" } - - { section: "keystone_authtoken", option: "auth_host", value: "{{ hostvars[groups['openstack'][0]]['contrail_address'] }}" } + - { section: "keystone_authtoken", option: "auth_host", value: "{{ contrail_haproxy_address }}" } - { section: "keystone_authtoken", option: "signing_dir", value: "/tmp/keystone-signing-nova" } + + +#- { section: "DEFAULT", option: "rabbit_host", value: "{{ hostvars[groups['config'][0]]['contrail_address'] }}" } +#- { section: "DEFAULT", option: "glance_host", value: "{{ hostvars[groups['openstack'][0]]['contrail_address'] }}" } +#- { section: "DEFAULT", option: "neutron_admin_auth_url", value: "http://{{ hostvars[groups['openstack'][0]]['contrail_address'] }}:35357/v2.0/" } +#- { section: "DEFAULT", option: "neutron_url", value: "http://{{ hostvars[groups['config'][0]]['contrail_address'] }}:9696/" } +#- { section: "DEFAULT", option: "novncproxy_base_url", value: "http://{{ hostvars[groups['openstack'][0]]['contrail_mgmt_address'] }}:5999/vnc_auto.html" } +#- { section: "database", option: "connection", value: "mysql://nova:nova@{{ hostvars[groups['openstack'][0]]['contrail_address'] }}/nova?charset=utf8" } +#- { section: "keystone_authtoken", option: "auth_host", value: "{{ hostvars[groups['openstack'][0]]['contrail_address'] }}" } + + + - name: "change database address if same node as first openstack node" ini_file: dest: "/etc/nova/nova.conf" diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml index 1a5ddf7b..3da783e1 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml @@ -16,14 +16,14 @@ lineinfile: dest: "/etc/ifmap-server/basicauthusers.properties" # line: "{{ hostvars[item]['contrail_address' ] }}:{{ hostvars[item]['contrail_address' ] }}" - line: "{{ contrail_address }}:{{ contrail_address }}" + line: "{{ haproxy_hosts[item] }}:{{ haproxy_hosts[item] }}" with_items: groups['opencontrail_control'] - name: "modify ifmap server basicauthusers properties for dns" lineinfile: dest: "/etc/ifmap-server/basicauthusers.properties" # line: "{{ hostvars[item]['contrail_address' ] }}.dns:{{ hostvars[item]['contrail_address' ] }}.dns" - line: "{{ contrail_address }}.dns:{{ contrail_address }}.dns" + line: "{{ haproxy_hosts[item] }}.dns:{{ haproxy_hosts[item] }}.dns" with_items: groups['opencontrail_control'] - name: "node-common" diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-database.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-database.yml index f95e7feb..04a1c993 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-database.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-database.yml @@ -20,8 +20,10 @@ # sudo: True lineinfile: dest: "/etc/hosts" - regexp: "^{{ contrail_address }}\t{{ ansible_hostname }}( .*)?$" - line: "{{ contrail_address }}\t{{ ansible_hostname }}\\1" +# regexp: "^{{ contrail_address }}\t{{ ansible_hostname }}( .*)?$" +# line: "{{ contrail_address }}\t{{ ansible_hostname }}\\1" + regexp: "^{{ contrail_address }}\t{{ inventory_hostname }}( .*)?$" + line: "{{ contrail_address }}\t{{ inventory_hostname }}\\1" backrefs: yes @@ -51,7 +53,7 @@ # sudo: True set_fact: # dbseeds: "{{ hostvars[item.1][ contrail_address ] }}" - dbseeds: "{{ contrail_address }}" + dbseeds: "{{ haproxy_hosts[item] }}" with_indexed_items: groups['opencontrail_database'] when: item.0 == 0 @@ -63,7 +65,7 @@ # sudo: True set_fact: # dbseeds: "{{ dbseeds }},{{ hostvars[item.1]['contrail_address'] }}" - dbseeds: "{{ dbseeds }},{{ contrail_address }}" + dbseeds: "{{ dbseeds }},{{ haproxy_hosts[item] }}" with_indexed_items: groups['opencontrail_database'] when: item.0 == 1 @@ -119,7 +121,7 @@ dest: "/etc/zookeeper/conf/zoo.cfg" regexp: "server.{{ item.0 + 1 }}=" # line: "server.{{ item.0 + 1 }}={{ hostvars[item.1]['contrail_address'] }}:2888:3888" - line: "server.{{ item.0 + 1 }}={{ contrail_address }}:2888:3888" + line: "server.{{ item.0 + 1 }}={{ haproxy_hosts[item] }}:2888:3888" with_indexed_items: groups['opencontrail_database'] @@ -143,7 +145,7 @@ # sudo: True set_fact: # zkaddrs: "{{ hostvars[item.1]['contrail_address'] }}:2181" - zkaddrs: "{{ contrail_address }}:2181" + zkaddrs: "{{ haproxy_hosts[item] }}:2181" with_indexed_items: groups['opencontrail_database'] when: item.0 == 0 @@ -152,7 +154,7 @@ # sudo: True set_fact: # zkaddrs: "{{ zkaddrs }},{{ hostvars[item.1]['contrail_address'] }}:2181" - zkaddrs: "{{ zkaddrs }},{{ contrail_address }}:2181" + zkaddrs: "{{ zkaddrs }},{{ haproxy_hosts[item] }}:2181" with_indexed_items: groups['opencontrail_database'] when: item.0 > 0 diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-rabbitmq.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-rabbitmq.yml index b2785d8f..58037bce 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-rabbitmq.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-rabbitmq.yml @@ -29,7 +29,8 @@ # sudo: True lineinfile: dest: "/etc/hosts" - line: "{{ hostvars[item]['contrail_address'] }}\t{{ hostvars[item]['ansible_hostname'] }} {{ hostvars[item]['ansible_hostname'] }}-ctrl" +# line: "{{ hostvars[item]['contrail_address'] }}\t{{ hostvars[item]['ansible_hostname'] }} {{ hostvars[item]['ansible_hostname'] }}-ctrl" + line: "{{ contrail_address }}\t{{ inventory_hostname }} {{ inventory_hostname }}-ctrl" with_items: groups['opencontrail_config'] diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-toragent.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-toragent.yml index 87810732..78b01e3f 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-toragent.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-toragent.yml @@ -69,9 +69,9 @@ run_once: yes - name: "add tor agent to contrail" - shell: "python /opt/contrail/utils/provision_vrouter.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --admin_tenant_name admin --openstack_ip {{ contrail_keystone_address }} --oper add --host_name {{ ansible_hostname }}-{{ item.ansible_facts.toragent_index }} --host_ip {{ contrail_address }} --router_type tor-agent" + shell: "python /opt/contrail/utils/provision_vrouter.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --admin_tenant_name admin --openstack_ip {{ contrail_keystone_address }} --oper add --host_name {{ inventory_hostname }}-{{ item.ansible_facts.toragent_index }} --host_ip {{ contrail_address }} --router_type tor-agent" with_items: contrail_toragent_list.results - name: "add device to contrail" - shell: "python /opt/contrail/utils/provision_physical_device.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --admin_tenant_name admin --openstack_ip {{ contrail_keystone_address }} --oper add --device_name {{ item.ansible_facts.toragent_params.name }} --vendor_name {{ item.ansible_facts.toragent_params.vendor_name }} --product_name {{ item.ansible_facts.toragent_params.product_name }} --device_mgmt_ip {{ item.ansible_facts.toragent_params.address }} --device_tunnel_ip {{ item.ansible_facts.toragent_params.tunnel_address }} --device_tor_agent {{ ansible_hostname }}-{{ item.ansible_facts.toragent_index }} --device_tsn {{ ansible_hostname }}" + shell: "python /opt/contrail/utils/provision_physical_device.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --admin_tenant_name admin --openstack_ip {{ contrail_keystone_address }} --oper add --device_name {{ item.ansible_facts.toragent_params.name }} --vendor_name {{ item.ansible_facts.toragent_params.vendor_name }} --product_name {{ item.ansible_facts.toragent_params.product_name }} --device_mgmt_ip {{ item.ansible_facts.toragent_params.address }} --device_tunnel_ip {{ item.ansible_facts.toragent_params.tunnel_address }} --device_tor_agent {{ inventory_hostname }}-{{ item.ansible_facts.toragent_index }} --device_tsn {{ inventory_hostname }}" with_items: contrail_toragent_list.results diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml index 1090ddaa..515b10e9 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml @@ -17,14 +17,14 @@ - name: "set first cassandra host address" set_fact: # cassandra_addrs: "'{{ hostvars[item.1]['contrail_address'] }}'" - cassandra_addrs: "'{{ contrail_address }}'" + cassandra_addrs: "'{{ haproxy_hosts[item] }}'" with_indexed_items: groups['opencontrail_database'] when: item.0 == 0 - name: "set second or more cassandra host addresses" set_fact: # cassandra_addrs: "{{ cassandra_addrs }}, '{{ hostvars[item.1]['contrail_address'] }}'" - cassandra_addrs: "{{ cassandra_addrs }}, '{{ contrail_address }}'" + cassandra_addrs: "{{ cassandra_addrs }}, '{{ haproxy_hosts[item] }}'" with_indexed_items: groups['opencontrail_database'] when: item.0 > 0 -- cgit 1.2.3-korg