if [ ! -e /etc/sysconfig/network-scripts/ifcfg-provisioning ] ; then
echo -e "DEVICE=provisioning\nTYPE=Bridge\nONBOOT=yes\nNM_CONTROLLED=no\nBOOTPROTO=static\nIPADDR=172.22.0.1\nNETMASK=255.255.255.0" | sudo dd of=/etc/sysconfig/network-scripts/ifcfg-provisioning
fi
- sudo ifdown provisioning || true
- sudo ifup provisioning
+ sudo ip link set dev provisioning down || true
+ sudo ip link set dev provisioning up
# Need to pass the provision interface for bare metal
if [ "$PRO_IF" ]; then
echo -e "DEVICE=$PRO_IF\nTYPE=Ethernet\nONBOOT=yes\nNM_CONTROLLED=no\nBRIDGE=provisioning" | sudo dd of="/etc/sysconfig/network-scripts/ifcfg-$PRO_IF"
- sudo ifdown "$PRO_IF" || true
- sudo ifup "$PRO_IF"
+ sudo ip link set dev "$PRO_IF" down || true
+ sudo ip link set dev "$PRO_IF" up
fi
fi
if [ ! -e /etc/sysconfig/network-scripts/ifcfg-baremetal ] ; then
echo -e "DEVICE=baremetal\nTYPE=Bridge\nONBOOT=yes\nNM_CONTROLLED=no" | sudo dd of=/etc/sysconfig/network-scripts/ifcfg-baremetal
fi
- sudo ifdown baremetal || true
- sudo ifup baremetal
+ sudo ip link set dev baremetal down || true
+ sudo ip link set dev baremetal up
# Add the internal interface to it if requests, this may also be the interface providing
# external access so we need to make sure we maintain dhcp config if its available
sudo virsh net-destroy baremetal
sudo virsh net-start baremetal
if [ "$INT_IF" ]; then #Need to bring UP the NIC after destroying the libvirt network
- sudo ifup "$INT_IF"
+ sudo ip link set dev "$INT_IF" up
fi
fi
fi
sudo rm -rf /etc/NetworkManager/conf.d/dnsmasq.conf
# There was a bug in this file, it may need to be recreated.
if [ "$MANAGE_PRO_BRIDGE" == "y" ]; then
- sudo ifdown provisioning || true
+ sudo ip link set dev provisioning down || true
sudo rm -f /etc/sysconfig/network-scripts/ifcfg-provisioning || true
fi
# Leaving this around causes issues when the host is rebooted
if [ "$MANAGE_BR_BRIDGE" == "y" ]; then
- sudo ifdown baremetal || true
+ sudo ip link set dev baremetal down || true
sudo rm -f /etc/sysconfig/network-scripts/ifcfg-baremetal || true
fi
# Adding an IP address in the libvirt definition for this network results in
# dnsmasq being run, we don't want that as we have our own dnsmasq, so set
# the IP address here
- sudo brctl addbr provisioning
- # sudo ifconfig provisioning 172.22.0.1 netmask 255.255.255.0 up
- # Use ip command. ifconfig commands are deprecated now.
+ sudo ip link add dev provisioning type bridge
sudo ip addr add dev provisioning 172.22.0.1/24
sudo ip link set provisioning up
# Need to pass the provision interface for bare metal
if [ "$PRO_IF" ]; then
- sudo brctl addif provisioning "$PRO_IF"
+ sudo ip link set dev "$PRO_IF" master provisioning
fi
fi
if [ "$MANAGE_INT_BRIDGE" == "y" ]; then
# Create the baremetal bridge
if ! [[ $(ip a show baremetal) ]]; then
- sudo brctl addbr baremetal
- # sudo ifconfig baremetal 192.168.111.1 netmask 255.255.255.0 up
- # Use ip command. ifconfig commands are deprecated now.
+ sudo ip link add dev baremetal type bridge
sudo ip addr add dev baremetal 192.168.111.1/24
sudo ip link set baremetal up
fi
# Add the internal interface to it if requests, this may also be the interface providing
# external access so we need to make sure we maintain dhcp config if its available
if [ "$INT_IF" ]; then
- sudo brctl addif "$INT_IF"
+ sudo ip link set dev "$INT_IF" master baremetal
fi
fi
sudo virsh net-destroy baremetal
sudo virsh net-start baremetal
if [ "$INT_IF" ]; then #Need to bring UP the NIC after destroying the libvirt network
- sudo ifup "$INT_IF"
+ sudo ip link set dev "$INT_IF" up
fi
fi
shell: |
sudo ip link set baremetal down
sudo ip link set provisioning down
- brctl delbr baremetal | true
- brctl delbr provisioning | true
+ ip link del baremetal type bridge | true
+ ip link del provisioning type bridge | true
when:
- ansible_distribution == 'Ubuntu'
vim \
wget \
git \
- software-properties-common \
- bridge-utils
+ software-properties-common
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
}
function configure_ironic_bridge {
- brctl addbr provisioning
+ ip link add dev provisioning type bridge
ip link set provisioning up
- brctl addif provisioning $IRONIC_INTERFACE
+ ip link set dev $IRONIC_INTERFACE master provisioning
ip addr add dev provisioning 172.22.0.1/24
}
done
ip link set provisioning down || true
-brctl delbr provisioning || true
+ip link del provisioning type bridge || true
rm -rf ${IRONIC_DATA_DIR}