2014-03-25 03:26:19 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
2018-04-15 03:30:48 +00:00
|
|
|
source /etc/profile
|
2014-03-25 03:26:19 +00:00
|
|
|
|
2018-04-15 03:30:48 +00:00
|
|
|
echo 'Installing extra packages and upgrading'
|
2014-03-25 03:26:19 +00:00
|
|
|
|
2016-06-27 12:07:22 +00:00
|
|
|
PACKAGES=(vim curl wget man-db openssh-server bash-completion ca-certificates sudo)
|
2015-12-27 15:34:32 +00:00
|
|
|
|
2018-04-15 03:30:48 +00:00
|
|
|
echo "Installing additional packages: ${ADDPACKAGES}"
|
2015-12-27 15:34:32 +00:00
|
|
|
PACKAGES+=" ${ADDPACKAGES}"
|
|
|
|
|
2014-03-25 03:26:19 +00:00
|
|
|
if [ $DISTRIBUTION = 'ubuntu' ]; then
|
|
|
|
PACKAGES+=' software-properties-common'
|
|
|
|
fi
|
|
|
|
|
2016-04-29 16:18:53 +00:00
|
|
|
ANSIBLE=${ANSIBLE:-0}
|
2018-04-15 13:55:37 +00:00
|
|
|
if [[ $ANSIBLE = 1 ]]; then
|
|
|
|
PACKAGES+=' ansible'
|
|
|
|
fi
|
|
|
|
|
2014-03-25 03:26:19 +00:00
|
|
|
CHEF=${CHEF:-0}
|
2018-04-15 13:55:37 +00:00
|
|
|
if [[ $CHEF = 1 ]]; then
|
|
|
|
PACKAGES+=' chef'
|
|
|
|
fi
|
|
|
|
|
2014-03-25 03:26:19 +00:00
|
|
|
PUPPET=${PUPPET:-0}
|
2018-04-15 13:55:37 +00:00
|
|
|
if [[ $PUPPET = 1 ]]; then
|
|
|
|
PACKAGES+=' puppet'
|
|
|
|
fi
|
|
|
|
|
2014-03-25 03:26:19 +00:00
|
|
|
SALT=${SALT:-0}
|
2018-04-15 13:55:37 +00:00
|
|
|
if [[ $SALT = 1 ]]; then
|
|
|
|
PACKAGES+=' salt-minion'
|
|
|
|
fi
|
|
|
|
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
export DEBIAN_PRIORITY=critical
|
|
|
|
apt-get update
|
|
|
|
apt-get install ${PACKAGES[*]} -y --force-yes
|
|
|
|
apt-get upgrade -y --force-yes
|
|
|
|
|
2014-03-25 03:26:19 +00:00
|
|
|
|
|
|
|
if [ $DISTRIBUTION = 'debian' ]; then
|
|
|
|
# Enable bash-completion
|
|
|
|
sed -e '/^#if ! shopt -oq posix; then/,/^#fi/ s/^#\(.*\)/\1/g' \
|
2018-04-15 03:30:48 +00:00
|
|
|
-i /etc/bash.bashrc
|
2014-03-25 03:26:19 +00:00
|
|
|
fi
|