- [[ -z $QUIET_MODE ]] && read -e -p "WARNING! Not tested Linux distribution '$_DISTRO_DISCOVER '. Continue assuming a '$_DISTRO $_RELEASE' type? (y/N)" KK
- [[ -z $QUIET_MODE ]] && [[ "$KK" != "y" ]] && [[ "$KK" != "yes" ]] && echo "Cancelled" && exit 1
-fi
-
-
-
-echo '
-#################################################################
-##### UPDATE REPOSITORIES #####
-#################################################################'
-[ "$_DISTRO" == "Ubuntu" ] && apt-get update -y
-
-[ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ] && yum check-update -y
-[ "$_DISTRO" == "CentOS" ] && sudo yum install -y epel-release
-[ "$_DISTRO" == "Red" ] && wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm \
- && sudo rpm -ivh epel-release-7-5.noarch.rpm && sudo yum install -y epel-release && rm -f epel-release-7-5.noarch.rpm
-[ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ] && sudo yum repolist
-
-
-echo '
-#################################################################
-##### INSTALL REQUIRED PACKAGES #####
-#################################################################'
-[ "$_DISTRO" == "Ubuntu" ] && install_packages "git screen wget mysql-server"
-[ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ] && install_packages "git screen wget mariadb mariadb-server"
-
-if [[ "$_DISTRO" == "Ubuntu" ]]
-then
- #start services. By default CentOS does not start services
- service mysql start >> /dev/null
- # try to set admin password, ignore if fails
- [[ -n $DBPASSWD ]] && mysqladmin -u $DBUSER -s password $DBPASSWD
-fi
-
-if [ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ]
-then
- #start services. By default CentOS does not start services
- service mariadb start
- service httpd start
- systemctl enable mariadb
- systemctl enable httpd
- read -e -p "Do you want to configure mariadb (recommended if not done before) (Y/n)" KK
- [ "$KK" != "n" -a "$KK" != "no" ] && mysql_secure_installation
-
- read -e -p "Do you want to set firewall to grant web access port 80,443 (Y/n)" KK
- [ "$KK" != "n" -a "$KK" != "no" ] &&
- firewall-cmd --permanent --zone=public --add-service=http &&
- firewall-cmd --permanent --zone=public --add-service=https &&
- firewall-cmd --reload
-fi
-
-#check and ask for database user password. Must be done after database installation
-if [[ -n $QUIET_MODE ]]
-then
- echo -e "\nCheking database connection and ask for credentials"
- while ! mysqladmin -s -u$DBUSER $DBPASSWD_PARAM status >/dev/null
- do
- [ -n "$logintry" ] && echo -e "\nInvalid database credentials!!!. Try again (Ctrl+c to abort)"
- [ -z "$logintry" ] && echo -e "\nProvide database credentials"
- read -e -p "database user? ($DBUSER) " DBUSER_
- [ -n "$DBUSER_" ] && DBUSER=$DBUSER_
- read -e -s -p "database password? (Enter for not using password) " DBPASSWD_
- [ -n "$DBPASSWD_" ] && DBPASSWD="$DBPASSWD_" && DBPASSWD_PARAM="-p$DBPASSWD_"
- [ -z "$DBPASSWD_" ] && DBPASSWD="" && DBPASSWD_PARAM=""
- logintry="yes"
- done
-fi
-
-echo '
-#################################################################
-##### INSTALL PYTHON PACKAGES #####
-#################################################################'
-[ "$_DISTRO" == "Ubuntu" ] && install_packages "python-yaml python-bottle python-mysqldb python-jsonschema python-paramiko python-argcomplete python-requests python-logutils"
-[ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ] && install_packages "PyYAML MySQL-python python-jsonschema python-paramiko python-argcomplete python-requests python-logutils"
-
-#The only way to install python-bottle on Centos7 is with easy_install or pip
-[ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ] && easy_install -U bottle
-
-#install openstack client needed for using openstack as a VIM
-[ "$_DISTRO" == "Ubuntu" ] && install_packages "python-novaclient python-keystoneclient python-glanceclient python-neutronclient"
-[ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ] && install_packages "python-devel" && easy_install python-novaclient python-keystoneclient python-glanceclient python-neutronclient #TODO revise if gcc python-pip is needed
-
-if [[ -z $NOCLONE ]]; then
- echo '
-#################################################################
-##### DOWNLOAD SOURCE #####
-#################################################################'
- su $SUDO_USER -c 'git clone '"${GIT_URL}"' openmano'
- #[[ -z $DEVELOP ]] && su $SUDO_USER -c 'git checkout <tag version>'