Update the bootstrap script to latest stable v2015.01.12

* Add package upgrades support to FreeBSD. Thanks William Eshagh(eshagl).
* Make sure wget is installed on debian bare systems.
* Make sure the Arch pacman database is up to date.
* Install `python-hashlib` in CentOS 5 in order to use the COPR repository.
This commit is contained in:
Pedro Algarvio 2015-01-12 22:16:15 +00:00
parent cfb867078e
commit 5f3bd0ee6e

View File

@ -17,7 +17,7 @@
# CREATED: 10/15/2012 09:49:37 PM WEST
#======================================================================================================================
set -o nounset # Treat unset variables as an error
__ScriptVersion="2014.12.11"
__ScriptVersion="2015.01.12"
__ScriptName="bootstrap-salt.sh"
#======================================================================================================================
@ -1993,6 +1993,9 @@ install_debian_6_deps() {
apt-get update
# Make sure wget is available
__apt_get_install_noinput wget
# Install Keys
__apt_get_install_noinput debian-archive-keyring && apt-get update
@ -2090,6 +2093,10 @@ install_debian_7_deps() {
export DEBIAN_FRONTEND=noninteractive
apt-get update
# Make sure wget is available
__apt_get_install_noinput wget
# Install Keys
__apt_get_install_noinput debian-archive-keyring && apt-get update
@ -2577,6 +2584,7 @@ install_centos_stable_deps() {
__install_epel_repository || return 1
if [ "$_ENABLE_EXTERNAL_ZMQ_REPOS" -eq $BS_TRUE ]; then
yum -y install python-hashlib || return 1
__install_saltstack_copr_zeromq_repository || return 1
fi
@ -2729,15 +2737,18 @@ install_centos_git_post() {
[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
if [ ! -f /usr/lib/systemd/system/salt-${fname}.service ] || ([ -f /usr/lib/systemd/system/salt-${fname}.service ] && [ $_FORCE_OVERWRITE -eq $BS_TRUE ]); then
copyfile "${__SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname}.service" /usr/lib/systemd/system/
if [ -f /bin/systemctl ]; then
if [ ! -f /usr/lib/systemd/system/salt-${fname}.service ] || ([ -f /usr/lib/systemd/system/salt-${fname}.service ] && [ $_FORCE_OVERWRITE -eq $BS_TRUE ]); then
copyfile "${__SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname}.service" /usr/lib/systemd/system/
fi
# Skip salt-api since the service should be opt-in and not necessarily started on boot
[ $fname = "api" ] && continue
/bin/systemctl enable salt-${fname}.service
SYSTEMD_RELOAD=$BS_TRUE
elif [ ! -f /usr/lib/systemd/system/salt-${fname}.service ] && [ ! -f /etc/init.d/salt-$fname ] || ([ -f /etc/init.d/salt-$fname ] && [ $_FORCE_OVERWRITE -eq $BS_TRUE ]); then
elif [ ! -f /etc/init.d/salt-$fname ] || ([ -f /etc/init.d/salt-$fname ] && [ $_FORCE_OVERWRITE -eq $BS_TRUE ]); then
copyfile "${__SALT_GIT_CHECKOUT_DIR}/pkg/rpm/salt-${fname}" /etc/init.d/
chmod +x /etc/init.d/salt-${fname}
@ -3373,6 +3384,12 @@ install_arch_linux_stable_deps() {
pacman-key --init && pacman-key --populate archlinux || return 1
fi
pacman -Sy --noconfirm --needed pacman || return 1
if [ "$(which pacman-db-upgrade)" != "" ]; then
pacman-db-upgrade || return 1
fi
if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then
pacman -Syyu --noconfirm --needed || return 1
fi
@ -3392,9 +3409,8 @@ install_arch_linux_stable_deps() {
install_arch_linux_git_deps() {
install_arch_linux_stable_deps
pacman -Sy --noconfirm --needed pacman || return 1
# Don't fail if un-installing python2-distribute threw an error
pacman -R --noconfirm --needed python2-distribute
pacman -R --noconfirm python2-distribute
pacman -Sy --noconfirm --needed git python2-crypto python2-setuptools python2-jinja \
python2-m2crypto python2-markupsafe python2-msgpack python2-psutil python2-yaml \
python2-pyzmq zeromq python2-requests python2-systemd || return 1
@ -3623,6 +3639,10 @@ install_freebsd_9_stable_deps() {
/usr/local/sbin/pkg install ${SALT_PKG_FLAGS} -y ${_EXTRA_PACKAGES} || return 1
fi
if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then
pkg upgrade -y || return 1
fi
return 0
}