diff --git a/CHANGELOG.md b/CHANGELOG.md index a6e6309..4a9808a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ for the list of changes in SaltStack. **3005.1_2** +- Ensure `salt-minion` is not installed. - Remove `GitPython` documentation, since it has some [using warnings](https://docs.saltproject.io/en/latest/topics/tutorials/gitfs.html#id2). - Add _Development_ section to [README.md](README.md). diff --git a/assets/build/install.sh b/assets/build/install.sh index 7b76fc9..69b200b 100755 --- a/assets/build/install.sh +++ b/assets/build/install.sh @@ -48,7 +48,7 @@ download "${BOOTSTRAP_URL}" "${BOOTSTRAP_FILE}" check_sha256 "${BOOTSTRAP_FILE}" "${BOOTSTRAP_SHA256}" # Bootstrap script options: -# https://docs.saltstack.com/en/latest/topics/tutorials/salt_bootstrap.html#command-line-options +# https://docs.saltproject.io/salt/install-guide/en/latest/topics/bootstrap.html ## -M: install Salt Master by default ## -N: Do not install salt-minion ## -X: Do not start daemons after installation @@ -65,6 +65,13 @@ log_debug "Options: ${SALT_BOOTSTRAP_OPTS[@]}" sh "${BOOTSTRAP_FILE}" ${SALT_BOOTSTRAP_OPTS[@]} git "v${SALT_VERSION}" chown -R "${SALT_USER}": "${SALT_ROOT_DIR}" +# Patch to remove salt-minion +SALT_MINION="$(command -v salt-minion)" +if [[ -n "${SALT_MINION}" ]]; then + log_warn "Removing salt-minion ..." + rm -f "${SALT_MINION}" +fi + # Configure ssh log_info "Configuring ssh ..." sed -i -e "s|^[# ]*StrictHostKeyChecking.*$| StrictHostKeyChecking no|" /etc/ssh/ssh_config diff --git a/tests/basic/test.sh b/tests/basic/test.sh index 90f4e22..af949be 100755 --- a/tests/basic/test.sh +++ b/tests/basic/test.sh @@ -26,6 +26,15 @@ echo "==> Executing healthcheck ..." docker-exec /usr/local/sbin/healthcheck | grep -i true || error "healthcheck" ok "healthcheck" +# Check salt-minion is not installed +# shellcheck disable=SC2016 +docker-exec bash -c 'test -z "$(command -v salt-minion)"' || error "salt-minion is installed inside the container" +ok "salt-minion is not installed inside the container" + +# shellcheck disable=SC2016 +docker-exec bash -c 'test -z "$(ps aux | grep salt-minion | grep -v grep)"' || error "salt-minion is running inside the container" +ok "salt-minion is not running inside the container" + # Test minion connection setup_and_start_salt_minion || error "salt-minion started" ok "salt-minion started"