From 1420da02369d5db05487ea13e29f47947e07b338 Mon Sep 17 00:00:00 2001 From: "chenshuai@huawei.com" Date: Fri, 25 Mar 2016 10:06:06 +0800 Subject: opencontrail: move vhost0 on eth1 JIRA: COMPASS-349 Change-Id: I61f481dd9b3aa7885ea3eaa3c7ba2d02c0556d2c Signed-off-by: chenshuai@huawei.com --- .../tasks/install/install-interface.yml | 10 +++++----- .../ansible/roles/open-contrail/tasks/main.yml | 7 ++++--- .../tasks/provision/provision-compute.yml | 14 +++++++------- .../open-contrail/tasks/uninstall-openvswitch.yml | 21 ++++++++++++--------- 4 files changed, 28 insertions(+), 24 deletions(-) (limited to 'deploy/adapters/ansible/roles/open-contrail/tasks') diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-interface.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-interface.yml index 05c30da0..3f7b43c1 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-interface.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-interface.yml @@ -10,9 +10,9 @@ #- hosts: all # sudo: yes # tasks: -- name: get last ip address - shell: expr substr `cat /etc/hostname` 5 1 - register: lastip +#- name: get last ip address +# shell: expr substr `cat /etc/hostname` 5 1 +# register: lastip #- name: "configure interface" ## sudo: True @@ -22,12 +22,12 @@ # with_items: # - "auto {{ contrail_vhost_device }}" # - "iface {{ contrail_vhost_device }} inet static" -# - "\taddress {{ contrail_vhost_address }}{{ lastip.stdout_lines[0] }}" +# - "\taddress {{ contrail_vhost_address }}" # - "\tnetmask {{ contrail_vhost_netmask }}" - name: "set interface address" # sudo: True - shell: "ifconfig {{ contrail_vhost_device }} {{ contrail_vhost_address }}{{ lastip.stdout_lines[0] }} netmask {{ contrail_vhost_netmask }}" + shell: "ifconfig {{ contrail_vhost_device }} {{ contrail_vhost_address }} netmask {{ contrail_vhost_netmask }}" - name: "up interface" # sudo: True diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml index 6c01f0f1..b1e9cbcd 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml @@ -53,9 +53,10 @@ # or inventory_hostname in groups['opencontrail_tsn'] -- name: Install interface on all hosts for Open Contrail - include: install/install-interface.yml - when: groups['opencontrail']|length !=0 +# change vhost0 on eth1 +#- name: Install interface on all hosts for Open Contrail +# include: install/install-interface.yml +# when: groups['opencontrail']|length !=0 #- include: install/install-common.yml #- include: install/install-kernel.yml 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 a4cd36db..d9258ef5 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 @@ -62,9 +62,9 @@ regexp: "dev=__DEVICE__" line: "dev={{ contrail_vhost_device }}" -- name: "get last ip address" - shell: expr substr `cat /etc/hostname` 5 1 - register: lastip +#- name: "get last ip address" +# shell: expr substr `cat /etc/hostname` 5 1 +# register: lastip - name: "fix up contrail vrouter agent config" template: @@ -89,9 +89,9 @@ - "sed -i -n -e '/auto .*/,$p' /tmp/contrail-interfaces-bottom" - "cat /tmp/contrail-interfaces-top /tmp/contrail-interfaces-bottom > /etc/network/interfaces" -- name: get last ip address - shell: expr substr `cat /etc/hostname` 5 1 - register: lastip +#- name: get last ip address +# shell: expr substr `cat /etc/hostname` 5 1 +# register: lastip - name: "configure interface" lineinfile: @@ -107,7 +107,7 @@ - "iface vhost0 inet static" - "\tpre-up /opt/contrail/bin/if-vhost0" - "\tnetwork_name application" - - "\taddress {{ contrail_vhost_address }}{{ lastip.stdout_lines[0] }}" + - "\taddress {{ contrail_vhost_address }}" - "\tnetmask {{ contrail_vhost_netmask }}" ################################################################################## diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/uninstall-openvswitch.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/uninstall-openvswitch.yml index 195a8990..55b1690e 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/uninstall-openvswitch.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/uninstall-openvswitch.yml @@ -26,17 +26,20 @@ shell: rmmod vport_vxlan; rmmod openvswitch; ignore_errors: True -- name: copy recovery script - copy: src={{ item }} dest=/opt/setup_networks - with_items: - - recover_network_opencontrail.py - - setup_networks_opencontrail.py - -- name: recover external script - shell: python /opt/setup_networks/recover_network_opencontrail.py +#- name: copy recovery script +# copy: src={{ item }} dest=/opt/setup_networks +# with_items: +# - recover_network_opencontrail.py +# - setup_networks_opencontrail.py +# +#- name: recover external script +# shell: python /opt/setup_networks/recover_network_opencontrail.py +# +#- name: modify net-init +# shell: sed -i 's/setup_networks.py/setup_networks_opencontrail.py/g' /etc/init.d/net_init - name: modify net-init - shell: sed -i 's/setup_networks.py/setup_networks_opencontrail.py/g' /etc/init.d/net_init + shell: sed -i '/setup_networks/d' /etc/init.d/net_init - name: resolve dual NIC problem shell: > -- cgit 1.2.3-korg