Move build steps into assets/build/install.sh

This commit is contained in:
Carlos Álvaro
2018-11-07 22:34:21 +01:00
parent 45df5e99a5
commit 1bb94cac4e
2 changed files with 32 additions and 23 deletions

21
assets/build/install.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -e
# Salt user
echo "Creating ${SALT_USER} user ..."
useradd -d ${SALT_HOME} -ms /bin/bash -U -G root,sudo ${SALT_USER}
# Bootstrap script options:
# https://docs.saltstack.com/en/latest/topics/tutorials/salt_bootstrap.html#command-line-options
## -M: install Salt Master by default
## -N: Do not install salt-minion
## -X: Do not start daemons after installation
## -P: Allow pip based installations
## -x: Changes the python version used to install a git version of salt
SALT_BOOTSTRAP_OPTS='-M -N -X -P -x python3'
echo "Installing saltstack ..."
wget -O bootstrap-salt.sh https://bootstrap.saltstack.com
sh bootstrap-salt.sh ${SALT_BOOTSTRAP_OPTS} stable ${SALT_VERSION}
chown -R ${SALT_USER}: ${SALT_ROOT_DIR}