aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/open-contrail
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/adapters/ansible/roles/open-contrail')
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/files/setup_networks_opencontrail.py12
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/uninstall-openvswitch.yml15
2 files changed, 17 insertions, 10 deletions
diff --git a/deploy/adapters/ansible/roles/open-contrail/files/setup_networks_opencontrail.py b/deploy/adapters/ansible/roles/open-contrail/files/setup_networks_opencontrail.py
index f8eb306a..fd7795af 100755
--- a/deploy/adapters/ansible/roles/open-contrail/files/setup_networks_opencontrail.py
+++ b/deploy/adapters/ansible/roles/open-contrail/files/setup_networks_opencontrail.py
@@ -75,6 +75,15 @@ def setup_ips_new(config):
LOG.info("setup_ips_new: cmd=%s" % cmd)
os.system(cmd)
+def setup_default_router(config):
+ LOG.info("setup_ips_new enter")
+ network = netaddr.IPNetwork(config["ip_settings"]["br-prv"]["cidr"])
+ intf_name = config["provider_net_mappings"][0]["interface"]
+ cmd = "route del default;"
+ cmd += "ip route add default via %s dev %s" % (config["ip_settings"]["br-prv"]["gw"], "vhost0")
+ LOG.info("setup_default_router: cmd=%s" % cmd)
+ os.system(cmd)
+
def remove_ovs_kernel_mod(config):
LOG.info("remove_ovs_kernel_mod enter")
cmd = "rmmod vport_vxlan; rmmod openvswitch;"
@@ -90,7 +99,8 @@ def main(config):
setup_intfs(config["sys_intf_mappings"], uplink_map)
setup_ips(config["ip_settings"], config["sys_intf_mappings"])
- setup_ips_new(config)
+# setup_ips_new(config)
+ setup_default_router(config)
if __name__ == "__main__":
config = yaml.load(open(config_path))
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 55b1690e..0714d2e9 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/uninstall-openvswitch.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/uninstall-openvswitch.yml
@@ -26,20 +26,17 @@
shell: rmmod vport_vxlan; rmmod openvswitch;
ignore_errors: True
-#- name: copy recovery script
-# copy: src={{ item }} dest=/opt/setup_networks
-# with_items:
+- name: copy recovery script
+ copy: src={{ item }} dest=/opt/setup_networks
+ with_items:
# - recover_network_opencontrail.py
-# - setup_networks_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 '/setup_networks/d' /etc/init.d/net_init
+ shell: sed -i 's/setup_networks.py/setup_networks_opencontrail.py/g' /etc/init.d/net_init
- name: resolve dual NIC problem
shell: >