diff options
author | chenshuai@huawei.com <chenshuai@huawei.com> | 2016-01-18 10:05:58 +0800 |
---|---|---|
committer | shuai chen <chenshuai@huawei.com> | 2016-01-21 14:49:30 +0000 |
commit | d81783305d2837eb2d76f8f3098bd06f2b58a5d2 (patch) | |
tree | fec57a0b7b505066229eb2aca706b0eb36929cd6 /deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-add-nodes.yml | |
parent | 9e1a57ca0b97e49813ae6c19dab7e12c21721717 (diff) |
bugfix: opencontrail automation deployment scripts
JIRA: COMPASS-277
Change-Id: Ia1f52c6e8e3de520cf06de99550c17879aaed2d7
Signed-off-by: chenshuai@huawei.com <chenshuai@huawei.com>
(cherry picked from commit 77944ac2791a631cfa785d16cc32dae8082b2719)
Diffstat (limited to 'deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-add-nodes.yml')
-rwxr-xr-x | deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-add-nodes.yml | 38 |
1 files changed, 30 insertions, 8 deletions
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 a9f34ed6..f1706700 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 @@ -4,23 +4,45 @@ # tasks: - name: "recover rabbitmq-server service script" - shell: if [ ! -f "\/etc\/init.d\/rabbitmq-server.initd.supervisord" ] ; then mv /etc/init.d/rabbitmq-server.initd.supervisord /home/rabbitmq-server.initd.supervisord; mv /etc/init.d/rabbitmq-server /home/rabbit-server; mv /etc/init.d/rabbitmq-server.backup /etc/init.d/rabbitmq-server; fi + shell: cp /home/rabbitmq-server /etc/init.d/rabbitmq-server - name: "restart rabbitmq-server" service: name: "rabbitmq-server" - state: "restarted" + state: "restarted" + +- name: "wait rabbitmq-server start" + shell: sleep 5 + +- name: "restart contrail-discovery" + service: + name: "contrail-discovery" + state: "restarted" + +- name: "wait contrail-discovery" + shell: sleep 5 + +- name: "restart contrail-api" + service: + name: "contrail-api" + state: "restarted" + +- name: "check contrail-api" + shell: lsof -ni :8082 ; while [ $? -ne 0 ]; do sleep 10; lsof -ni :8082; done; sleep 20; + +- name: "wait contrail-api" + shell: sleep 20 - name: "provision config node" shell: "python /opt/contrail/utils/provision_config_node.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --admin_tenant_name admin --oper add --host_name {{ ansible_hostname }} --host_ip {{ contrail_address }}" - when: inventory_hostname in groups['opencontrail_config'] +# when: inventory_hostname in groups['opencontrail_config'] #- hosts: database # sudo: yes # tasks: - name: "provision database node" shell: "python /opt/contrail/utils/provision_database_node.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --admin_tenant_name admin --oper add --host_name {{ ansible_hostname }} --host_ip {{ contrail_address }}" - when: inventory_hostname in groups['opencontrail_database'] +# when: inventory_hostname in groups['opencontrail_database'] #- hosts: collector @@ -28,14 +50,14 @@ # tasks: - name: "provision collector node" shell: "python /opt/contrail/utils/provision_analytics_node.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --admin_tenant_name admin --oper add --host_name {{ ansible_hostname }} --host_ip {{ contrail_address }}" - when: inventory_hostname in groups['opencontrail_collector'] +# when: inventory_hostname in groups['opencontrail_collector'] #- hosts: control # sudo: yes # tasks: - name: "provision control node" shell: "python /opt/contrail/utils/provision_control.py --api_server_ip {{ contrail_haproxy_address }} --api_server_port 8082 --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --admin_tenant_name admin --oper add --host_name {{ ansible_hostname }} --host_ip {{ contrail_address }} --router_asn {{ contrail_router_asn }}" - when: inventory_hostname in groups['opencontrail_control'] +# when: inventory_hostname in groups['opencontrail_control'] #- hosts: config # sudo: yes @@ -43,7 +65,7 @@ - name: "provision metadata services" shell: "python /opt/contrail/utils/provision_linklocal.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --admin_tenant_name admin --oper add --ipfabric_service_ip 10.84.50.1 --ipfabric_service_port 8775 --linklocal_service_name metadata --linklocal_service_ip 169.254.169.254 --linklocal_service_port 80" run_once: yes - when: inventory_hostname in groups['opencontrail_config'] +# when: inventory_hostname in groups['opencontrail_config'] #- hosts: config @@ -52,5 +74,5 @@ - name: "provision encap" 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'] +# when: inventory_hostname in groups['opencontrail_config'] |