devstack: Install vrf kernel module if needed

Depending on how the kernel was compiled vrf kernel module may not be
present on the box. This patch installs required packages that contain
vrf kernel module and installs the module as part of
`install_ovn_bgp_agent` function.

Change-Id: Ieb8351cf4eef6db7dc56fb21be9d0cedf6d2ffca
This commit is contained in:
Jakub Libosvar 2024-01-09 19:36:25 +00:00
parent 69ea9a96dc
commit 9e3a54805a

View File

@ -83,6 +83,21 @@ function cleanup_frr {
sudo rm -rf $FRR_CONF_DIR
}
function install_vrf_kernel_module_if_needed {
# If the kernel vrf was compiled separately as a module
if [ "$(grep CONFIG_NET_VRF /boot/config-$(uname -r) | cut -d = -f 2)" == "m" ]; then
if is_ubuntu; then
apt_get install linux-modules-extra-$(uname -r)
fi
if is_fedora; then
sudo dnf install -y kernel-modules-core-$(uname -r)
fi
sudo modprobe vrf
fi
}
function install_ovn_bgp_agent {
echo_summary "Installing OVN BGP Agent"
@ -95,6 +110,8 @@ function install_ovn_bgp_agent {
write_user_unit_file $OVN_BGP_AGENT_SYSTEMD_SERVICE "$cmd" "" "root"
$SYSTEMCTL daemon-reload
enable_service $OVN_BGP_AGENT_SYSTEMD_SERVICE
install_vrf_kernel_module_if_needed
}
function configure_ovn_bgp_agent {