#3782 -- Make Ansible update/install scripts use the same apt calls.
This commit is contained in:
parent
4eeb725436
commit
3018c01eab
|
@ -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}"
|
||||
|
||||
|
|
23
update.sh
23
update.sh
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue