X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Finstall_osm.sh;h=bacf424efdc7bd716209fdccd1500dfb95e221ad;hb=0ee30e1c287e82cfa181142ca40c8bd598419b43;hp=15037c7820bba03d4ca5b8d7fc68eb5c3d6fa409;hpb=831ee56cc75dd61fd026fb8fc406f7e2f7df832d;p=osm%2Fdevops.git diff --git a/installers/install_osm.sh b/installers/install_osm.sh index 15037c78..bacf424e 100755 --- a/installers/install_osm.sh +++ b/installers/install_osm.sh @@ -533,7 +533,7 @@ function install_juju() { echo "Installing juju" sudo snap install juju --classic sudo dpkg-reconfigure -p medium lxd - juju bootstrap localhost osm + sg lxd -c "juju bootstrap localhost osm" echo "Finished installation of juju" } @@ -561,7 +561,7 @@ EONG function generate_docker_env_files() { echo "Generating docker env files" OSMLCM_VCA_HOST=`juju show-controller|grep api-endpoints|awk -F\' '{print $2}'|awk -F\: '{print $1}'` - OSMLCM_VCA_SECRET=`grep password /home/ubuntu/.local/share/juju/accounts.yaml |awk '{print $2}'` + OSMLCM_VCA_SECRET=`grep password ${HOME}/.local/share/juju/accounts.yaml |awk '{print $2}'` MYSQL_ROOT_PASSWORD=`date +%s | sha256sum | base64 | head -c 32` echo "OSMLCM_VCA_HOST=${OSMLCM_VCA_HOST}" |sudo tee ${OSM_DEVOPS}/installers/docker/lcm.env echo "OSMLCM_VCA_SECRET=${OSMLCM_VCA_SECRET}" |sudo tee -a ${OSM_DEVOPS}/installers/docker/lcm.env @@ -589,6 +589,16 @@ function install_lightweight() { DEFAULT_IF=`route -n |awk '$1~/^0.0.0.0/ {print $8}'` DEFAULT_IP=`ip -o -4 a |grep ${DEFAULT_IF}|awk '{split($4,a,"/"); print a[1]}'` DEFAULT_MTU=$(ip addr show ${DEFAULT_IF} | perl -ne 'if (/mtu\s(\d+)/) {print $1;}') + need_packages_lw="lxd" + echo -e "Checking required packages: $need_packages_lw" + dpkg -l $need_packages_lw &>/dev/null \ + || ! echo -e "One or several required packages are not installed. Updating apt cache requires root privileges." \ + || sudo apt-get update \ + || FATAL "failed to run apt-get update" + dpkg -l $need_packages_lw &>/dev/null \ + || ! echo -e "Installing $need_packages_lw requires root privileges." \ + || sudo apt-get install -y $need_packages_lw \ + || FATAL "failed to install $need_packages_lw" install_juju install_docker_ce #install_docker_compose