+function install_ovs() {
+ local -r node=${1}
+ local -r rpm_path=${2}
+
+ if [ "${OVS_INSTALL:0:1}" = "v" ]; then
+ # An OVS version was given, so we build it ourselves from OVS git repo.
+ # Only on the first node though, consecutive nodes will use RPMs
+ # built for the first one.
+ [ ! -d "${rpm_path}" ] && mkdir -p "${rpm_path}" && build_ovs ${node} ${OVS_INSTALL} "${rpm_path}"
+ # Install OVS from path
+ install_ovs_from_path ${node} "${rpm_path}"
+ elif [ "${OVS_INSTALL:0:4}" = "http" ]; then
+ # Otherwise, install from rpm repo directly.
+ install_ovs_from_repo ${node} ${OVS_INSTALL}
+ else
+ echo "Expected either an OVS version git tag or a repo http url"
+ exit 1
+ fi
+}
+