if [ -z "$DEFAULT_IP" ]; then
DEFAULT_IF=$(ip route list|awk '$1=="default" {print $5; exit}')
- [ -z "$DEFAULT_IF" ] && DEFAULT_IF=$(route -n |awk '$1~/^0.0.0.0/ {print $8; exit}')
+ [ -z "$DEFAULT_IF" ] && DEFAULT_IF=$(ip route list|awk '$1=="default" {print $5; exit}')
[ -z "$DEFAULT_IF" ] && FATAL "Not possible to determine the interface with the default route 0.0.0.0"
DEFAULT_IP=`ip -o -4 a |grep ${DEFAULT_IF}|awk '{split($4,a,"/"); print a[1]}'`
[ -z "$DEFAULT_IP" ] && FATAL "Not possible to determine the IP address of the interface with the default route"
sudo -H LC_ALL=C python3 -m pip install -U pip
sudo -H LC_ALL=C python3 -m pip install -U python-magic pyangbind verboselogs
sudo apt-get install -y python3-osm-im python3-osmclient
+ if [ -f /usr/lib/python3/dist-packages/osm_im/requirements.txt ]; then
+ python3 -m pip install -r /usr/lib/python3/dist-packages/osm_im/requirements.txt
+ fi
+ if [ -f /usr/lib/python3/dist-packages/osmclient/requirements.txt ]; then
+ sudo apt-get install -y libcurl4-openssl-dev libssl-dev
+ python3 -m pip install -r /usr/lib/python3/dist-packages/osmclient/requirements.txt
+ fi
#sed 's,OSM_SOL005=[^$]*,OSM_SOL005=True,' -i ${HOME}/.bashrc
#echo 'export OSM_HOSTNAME=localhost' >> ${HOME}/.bashrc
#echo 'export OSM_SOL005=True' >> ${HOME}/.bashrc
}
function install_k8s_storageclass() {
- kubectl apply -f https://openebs.github.io/charts/openebs-operator-1.6.0.yaml
- local storageclass_timeout=300
+ OPENEBS_DIR="$(mktemp -d -q --tmpdir "openebs.XXXXXX")"
+ trap 'rm -rf "${OPENEBS_DIR}"' EXIT
+ wget -q https://openebs.github.io/charts/openebs-operator-1.6.0.yaml -P $OPENEBS_DIR
+ kubectl apply -f $OPENEBS_DIR
+ local storageclass_timeout=400
local counter=0
+ local storageclass_ready=""
echo "Waiting for storageclass"
while (( counter < storageclass_timeout ))
do
if [ $? -eq 0 ] ; then
echo "Storageclass available"
+ storageclass_ready="y"
break
else
counter=$((counter + 15))
sleep 15
fi
done
+ [ -n "$storageclass_ready" ] || FATAL "Storageclass not ready after $storageclass_timeout seconds. Cannot install openebs"
kubectl patch storageclass openebs-hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
}
DEFAULT_IF=$(ip route list|awk '$1=="default" {print $5; exit}')
[ -z "$DEFAULT_IF" ] && DEFAULT_IF=$(route -n |awk '$1~/^0.0.0.0/ {print $8; exit}')
[ -z "$DEFAULT_IF" ] && FATAL "Not possible to determine the interface with the default route 0.0.0.0"
- DEFAULT_IP=`ip -o -4 a |grep ${DEFAULT_IF} |awk '{split($4,a,"/"); print a[1]}'`
+ DEFAULT_IP=`ip -o -4 a s ${DEFAULT_IF} |awk '{split($4,a,"/"); print a[1]}'`
[ -z "$DEFAULT_IP" ] && FATAL "Not possible to determine the IP address of the interface with the default route"
DEFAULT_MTU=$(ip addr show ${DEFAULT_IF} | perl -ne 'if (/mtu\s(\d+)/) {print $1;}')
fi
# Install Pip for Python3
- $WORKDIR_SUDO apt install -y python3-pip
+ $WORKDIR_SUDO apt install -y python3-pip python3-venv
$WORKDIR_SUDO -H LC_ALL=C python3 -m pip install -U pip
# Create a venv to avoid conflicts with the host installation
source $OPENSTACK_PYTHON_VENV/bin/activate
- # Install Ansible, OpenStack client and SDK
+ # Install Ansible, OpenStack client and SDK, latest openstack version supported is Train
python -m pip install -U wheel
- python -m pip install -U python-openstackclient "openstacksdk>=0.12.0,<1" "ansible>=2.10,<2.11"
+ python -m pip install -U "python-openstackclient<=4.0.2" "openstacksdk>=0.12.0,<=0.36.2" "ansible>=2.10,<2.11"
# Install the Openstack cloud module (ansible>=2.10)
ansible-galaxy collection install openstack.cloud