Update comments, tune ssh_config for ci env
Change-Id: I6898192962591cd4a637e3665ec8a7b2450114f1
diff --git a/bootstrap.sh b/bootstrap.sh
index d7ce71b..4f916e4 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -6,10 +6,9 @@
# - http://github.com/salt-formulas-scripts
# - http://github.com/salt-formulas/salt-formula-salt (salt.master sls)
-# TODO:
-# - use PPA repository as formula source
-# - support for spm/yum
-
+# NOTE: This script is collection of shared functions to automate bootstrap of "salted" CI environments.
+# Its not intended to be used in PRODUCTION unless you know what you are doing.
+# You have been warned!
# Source specific env vars.
# shopt -u dotglob
@@ -89,6 +88,9 @@
# the version below is used salt pillar data
SALT_VERSION=${SALT_VERSION:-latest}
+# SECURITY
+SSH_STRICTHOSTKEYCHECKING=False
+
# environment
if [ "$FORMULAS_SOURCE" == "git" ]; then
SALT_ENV=${SALT_ENV:-dev}
@@ -219,16 +221,26 @@
# Main calls
system_config_ssh_conf() {
- for conf in ~/.ssh/config /root/.ssh/config; do
- $SUDO mkdir -p $(dirname $conf)
- if ! grep StrictHostKeyChecking $conf; then
- # this should be used only in CI environment
- echo -e "Host *\n\tStrictHostKeyChecking no\n" | $SUDO tee $conf >/dev/null
- fi
- done
+ # for current user
+ conf=~/.ssh/config
+ mkdir -p $(dirname $conf)
+ touch $conf
+ if ! $SSH_STRICTHOSTKEYCHECKING; then
+ echo -e "Host *\n\tStrictHostKeyChecking no\n" | tee -a $conf >/dev/null
+ fi
+ touch ~/.ssh/known_hosts
if ! grep github.com ~/.ssh/known_hosts; then
ssh-keyscan -H github.com >> ~/.ssh/known_hosts || true
+ ssh-keyscan -H gitlab.com >> ~/.ssh/known_hosts || true
fi
+
+ # for root
+ #conf=/root/.ssh/config
+ #$SUDO mkdir -p $(dirname $conf)
+ #$SUDO touch $conf
+ #if ! $SSH_STRICTHOSTKEYCHECKING; then
+ # echo -e "Host *\n\tStrictHostKeyChecking no\n" | $SUDO tee -a $conf >/dev/null
+ #fi
}
system_config_salt_modules_prereq() {