############################################################################## # Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## --- - name: add ovs bridge openvswitch_bridge: bridge={{ item["name"] }} state=present with_items: "{{ network_cfg['provider_net_mappings'] }}" when: item["type"] == "ovs" - name: add ovs uplink openvswitch_port: bridge={{ item["name"] }} port={{ item["interface"] }} state=present with_items: "{{ network_cfg['provider_net_mappings'] }}" when: item["type"] == "ovs" - name: copy recovery script copy: src={{ item }} dest=/opt/setup_networks with_items: - recover_network.py - name: recover external script shell: python /opt/setup_networks/recover_network.py