Skip to content

Commit

Permalink
Copy files from system-merged onto system and remove them on rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
rcarrillocruz committed Dec 1, 2020
1 parent 8c34cb7 commit bf586cf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions templates/common/_base/files/configure-ovs-network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ contents:
# check if connection is active
if nmcli --fields GENERAL.STATE conn show ovs-if-br-ex | grep -i "activated"; then
echo "OVS successfully configured"
cp /etc/NetworkManager/system-connections-merged/{br-ex,ovs-if-br-ex,ovs-port-br-ex,ovs-if-phys0,ovs-port-phys0}.nmconnection /etc/NetworkManager/system-connections
ip a show br-ex
configure_driver_options ${iface}
exit 0
Expand All @@ -221,6 +222,7 @@ contents:
while [ $counter -lt 5 ]; do
if nmcli conn up ovs-if-br-ex; then
echo "OVS successfully configured"
cp /etc/NetworkManager/system-connections-merged/{br-ex,ovs-if-br-ex,ovs-port-br-ex,ovs-if-phys0,ovs-port-phys0}.nmconnection /etc/NetworkManager/system-connections
ip a show br-ex
configure_driver_options ${iface}
exit 0
Expand Down Expand Up @@ -260,6 +262,7 @@ contents:
nmcli c del br-ex
fi
rm -f /etc/NetworkManager/system-connections/{br-ex,ovs-if-br-ex,ovs-port-br-ex,ovs-if-phys0,ovs-port-phys0}.nmconnection
# remove bridges created by ovn-kubernetes, try to delete br-ex again in case NM fail to talk to ovsdb
ovs-vsctl --timeout=30 --if-exists del-br br-int -- --if-exists del-br br-local -- --if-exists del-br br-ex
fi

0 comments on commit bf586cf

Please sign in to comment.