feat: Add salt-api support
This commit is contained in:
@@ -15,7 +15,7 @@ DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recomm
|
||||
|
||||
# Create salt user
|
||||
echo "Creating ${SALT_USER} user ..."
|
||||
useradd -d ${SALT_HOME} -ms /bin/bash -U -G root,sudo ${SALT_USER}
|
||||
useradd -d ${SALT_HOME} -ms /bin/bash -U -G root,sudo,shadow ${SALT_USER}
|
||||
|
||||
# Set PATH
|
||||
exec_as_salt cat >> ${SALT_HOME}/.profile <<EOF
|
||||
@@ -42,7 +42,7 @@ cmake --build . --target install
|
||||
echo "Installing python3 packages ..."
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recommends \
|
||||
python3-mako python3-pycryptodome python3-cherrypy3 python3-git python3-u-msgpack \
|
||||
python3-redis python3-gnupg python3-mysqldb python3-dateutil python3-libnacl
|
||||
python3-redis python3-gnupg python3-mysqldb python3-dateutil python3-libnacl python3-openssl
|
||||
|
||||
# Install pip3 python packages
|
||||
echo "Installing pip3 python packages ..."
|
||||
@@ -54,13 +54,16 @@ pip3 install "pygit2==v${PYGIT2_VERSION}" \
|
||||
## -M: install Salt Master by default
|
||||
## -N: Do not install salt-minion
|
||||
## -X: Do not start daemons after installation
|
||||
## -d: Disables checking if Salt services are enabled to start on system boot
|
||||
## -P: Allow pip based installations
|
||||
## -p: Extra-package to install
|
||||
## -x: Changes the python version used to install a git version of salt
|
||||
SALT_BOOTSTRAP_OPTS="-M -N -X -P -x python${PYTHON_VERSION}"
|
||||
SALT_BOOTSTRAP_OPTS=( -M -N -X -d -P -p salt-api -x "python${PYTHON_VERSION}" )
|
||||
|
||||
echo "Installing saltstack ..."
|
||||
echo "Option: ${SALT_BOOTSTRAP_OPTS[@]}"
|
||||
wget -O bootstrap-salt.sh https://bootstrap.saltstack.com
|
||||
sh bootstrap-salt.sh ${SALT_BOOTSTRAP_OPTS} git v${SALT_VERSION}
|
||||
sh bootstrap-salt.sh ${SALT_BOOTSTRAP_OPTS[@]} git v${SALT_VERSION}
|
||||
chown -R ${SALT_USER}: ${SALT_ROOT_DIR}
|
||||
|
||||
# Configure ssh
|
||||
@@ -89,7 +92,7 @@ priority=5
|
||||
directory=${SALT_HOME}
|
||||
environment=HOME=${SALT_HOME}
|
||||
command=/usr/local/bin/salt-master
|
||||
user=${SALT_USER}
|
||||
user=root
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stopsignal=QUIT
|
||||
|
||||
Reference in New Issue
Block a user