-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
+ echo -e "\n"\
+ "#################################################################\n"\
+ "##### UPDATE REPOSITORIES #####\n"\
+ "#################################################################"
+ [ "$_DISTRO" == "Ubuntu" ] && apt-get update -y &&
+ add-apt-repository -y cloud-archive:pike && apt-get update -y
+
+ [ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ] && yum check-update -y
+ [ "$_DISTRO" == "CentOS" ] && yum install -y epel-release
+ [ "$_DISTRO" == "Red" ] && wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm \
+ && rpm -ivh epel-release-7-5.noarch.rpm && yum install -y epel-release && rm -f epel-release-7-5.noarch.rpm
+ [ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ] && yum repolist
+
+ echo -e "\n"\
+ "#################################################################\n"\
+ "##### INSTALL REQUIRED PACKAGES #####\n"\
+ "#################################################################"
+ [ "$_DISTRO" == "Ubuntu" ] && install_packages "git make screen wget mysql-client"
+ [ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ] && install_packages "git make screen wget mariadb-client"
+
+ echo -e "\n"\
+ "#################################################################\n"\
+ "##### INSTALL PYTHON PACKAGES #####\n"\
+ "#################################################################"
+ [ "$_DISTRO" == "Ubuntu" ] && install_packages "python-yaml python-bottle python-mysqldb python-jsonschema "\
+ "python-paramiko python-argcomplete python-requests python-logutils libxml2-dev libxslt-dev python-dev "\
+ "python-pip python-crypto"
+ [ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ] && install_packages "PyYAML MySQL-python python-jsonschema "\
+ "python-paramiko python-argcomplete python-requests python-logutils libxslt-devel libxml2-devel python-devel "\
+ "python-pip python-crypto"
+ # The only way to install python-bottle on Centos7 is with easy_install or pip
+ [ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ] && easy_install -U bottle
+
+ # required for vmware connector TODO move that to separete opt in install script
+ pip install pip==9.0.3 || exit 1 # --upgrade pip install pip 10 that does not work
+ pip install pyvcloud==19.1.1 || exit 1
+ pip install progressbar || exit 1
+ pip install prettytable || exit 1
+ pip install pyvmomi || exit 1
+
+ # required for OpenNebula connector
+ pip install untangle || exit 1
+ pip install -e git+https://github.com/python-oca/python-oca#egg=oca || exit 1
+
+ # required for AWS connector
+ [ "$_DISTRO" == "Ubuntu" ] && install_packages "python-boto"
+ [ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ] && install_packages "python-boto" #TODO check if at Centos it exists with this name, or PIP should be used
+
+ # install openstack client needed for using openstack as a VIM
+ [ "$_DISTRO" == "Ubuntu" ] && install_packages "python-novaclient python-keystoneclient python-glanceclient "\
+ "python-neutronclient python-cinderclient python-openstackclient"
+ [ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ] && install_packages "python-devel" && easy_install \
+ python-novaclient python-keystoneclient python-glanceclient python-neutronclient python-cinderclient \
+ python-openstackclient #TODO revise if gcc python-pip is needed
+fi # [[ -z "$NO_PACKAGES" ]]