#3782 -- Make Ansible update/install scripts use the same apt calls.

This commit is contained in:
Buster "Silver Eagle" Neece 2021-02-06 15:25:33 -06:00
parent 4eeb725436
commit 3018c01eab
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
2 changed files with 35 additions and 35 deletions

View File

@ -18,10 +18,6 @@ if [[ $DISTRIB_ID != "Ubuntu" ]]; then
exit 0
fi
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' ansible | grep "install ok installed")
echo "Checking for Ansible: $PKG_OK"
if [[ "" == "$PKG_OK" ]]; then
sudo apt-get update
sudo apt-get install -q -y software-properties-common
@ -33,7 +29,6 @@ if [[ "" == "$PKG_OK" ]]; then
sudo apt-get install -q -y python2.7 python-pip python-mysqldb ansible
fi
fi
APP_ENV="${APP_ENV:-production}"

View File

@ -14,23 +14,28 @@ while [[ "$1" =~ ^- && ! "$1" == "--" ]]; do
done
if [[ "$1" == '--' ]]; then shift; fi
APP_ENV="${APP_ENV:-production}"
UPDATE_REVISION="${UPDATE_REVISION:-60}"
. /etc/lsb-release
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' ansible | grep "install ok installed")
echo "Checking for Ansible: $PKG_OK"
if [[ $DISTRIB_ID != "Ubuntu" ]]; then
echo "Ansible installation is only supported on Ubuntu distributions."
exit 0
fi
if [[ "" == "$PKG_OK" ]]; then
sudo apt-get update
sudo apt-get install -q -y software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -q -y ansible python-mysqldb
if [[ $DISTRIB_CODENAME == "focal" ]]; then
sudo apt-get install -q -y ansible python3-pip python3-mysqldb
else
sudo add-apt-repository -y ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -q -y ansible python-mysqldb
sudo apt-get install -q -y python2.7 python-pip python-mysqldb ansible
fi
APP_ENV="${APP_ENV:-production}"
UPDATE_REVISION="${UPDATE_REVISION:-60}"
echo "Updating AzuraCast (Environment: $APP_ENV, Update revision: $UPDATE_REVISION)"
if [[ ${APP_ENV} == "production" ]]; then