95b64eebe2d269f7d0f52a330d9d0a20a925bad8
[compass4nfv.git] /
1 ##############################################################################
2 # Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others.
3 #
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 ##############################################################################
9 ---
10
11 - name: check br-ex
12   shell: ovs-vsctl list-br | grep br-ex; while [ $? -ne 0 ]; do sleep 10; ovs-vsctl list-br | grep br-ex; done
13
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"
18
19 - name: wait 10 seconds
20   shell: sleep 10
21
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"
26
27 - name: copy recovery script
28   copy:  src={{ item }} dest=/opt/setup_networks
29   with_items:
30     - recover_network_odl_l3.py
31     - setup_networks_odl_l3.py
32
33 - name: recover external script
34   shell: python /opt/setup_networks/recover_network_odl_l3.py
35
36 - name: update keepalived info
37   template: src=keepalived.conf dest=/etc/keepalived/keepalived.conf
38   when: inventory_hostname in groups['odl'] 
39
40 - name: modify net-init
41   shell: sed -i 's/setup_networks.py/setup_networks_odl_l3.py/g' /etc/init.d/net_init