1 ##############################################################################
2 # Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
12 shell: ovs-vsctl list-br | grep br-ex; while [ $? -ne 0 ]; do sleep 10; ovs-vsctl list-br | grep br-ex; done
14 - name: add ovs uplink
15 openvswitch_port: bridge=br-ex port={{ item["interface"] }} state=present
16 with_items: "{{ network_cfg['provider_net_mappings'] }}"
17 when: item["type"] == "ovs"
19 - name: wait 10 seconds
22 - name: set external nic in openvswitch
23 shell: ovs-vsctl set Open_vSwitch $(ovs-vsctl show | head -n 1) other_config:provider_mappings=br-ex:{{ item["interface"] }}
24 with_items: "{{ network_cfg['provider_net_mappings'] }}"
25 when: item["type"] == "ovs"
27 - name: copy recovery script
28 copy: src={{ item }} dest=/opt/setup_networks
30 - recover_network_odl_l3.py
31 - setup_networks_odl_l3.py
33 - name: recover external script
34 shell: python /opt/setup_networks/recover_network_odl_l3.py
36 - name: update keepalived info
37 template: src=keepalived.conf dest=/etc/keepalived/keepalived.conf
38 when: inventory_hostname in groups['odl']
40 - name: modify net-init
41 shell: sed -i 's/setup_networks.py/setup_networks_odl_l3.py/g' /etc/init.d/net_init