Merge branch 'develop' of github.com:salt-formulas/salt-formulas-scripts into develop
Change-Id: I0d5a1ca39d78601810094f172929c4f0f8492478
diff --git a/bootstrap.sh b/bootstrap.sh
index 4f916e4..9a42838 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -89,7 +89,7 @@
SALT_VERSION=${SALT_VERSION:-latest}
# SECURITY
-SSH_STRICTHOSTKEYCHECKING=False
+SSH_STRICTHOSTKEYCHECKING=no
# environment
if [ "$FORMULAS_SOURCE" == "git" ]; then
@@ -220,15 +220,15 @@
##########################################
# Main calls
-system_config_ssh_conf() {
- # for current user
+ci_config_ssh() {
+
+ # for CI 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
+ echo -e "Host *\n\tStrictHostKeyChecking $SSH_STRICTHOSTKEYCHECKING\n" | tee -a $conf >/dev/null
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
@@ -243,6 +243,12 @@
#fi
}
+# DEPRECATED
+system_config_ssh_conf() {
+ # for backward compatibility
+ ci_config_ssh
+}
+
system_config_salt_modules_prereq() {
# salt-formulas custom modules dependencies, etc:
$SUDO $PKGTOOL install -y iproute2 curl sudo apt-transport-https python-psutil python-apt python-m2crypto python-oauth python-pip &>/dev/null
@@ -256,18 +262,12 @@
log_info "System configuration salt master"
system_config_salt_modules_prereq
- system_config_ssh_conf
+ ci_config_ssh
if ! grep '127.0.1.2.*salt' /etc/hosts; then
echo "127.0.1.2 salt" | $SUDO tee -a /etc/hosts >/dev/null
fi
- # DEPRECATED, should be removed or moved to salt master specific function
- which reclass-salt || {
- test -e /usr/share/reclass/reclass-salt && {
- ln -fs /usr/share/reclass/reclass-salt /usr/bin
- }
- }
}
configure_salt_master()
@@ -403,6 +403,11 @@
case ${VERSION} in
pkg|package)
which reclass || $SUDO $PKGTOOL install -y reclass
+ which reclass-salt || {
+ if [ -e /usr/share/reclass/reclass-salt ]; then
+ ln -fs /usr/share/reclass/reclass-salt /usr/bin
+ fi
+ }
;;
*)
log_warn "Install development version of reclass"
@@ -437,12 +442,6 @@
;;
esac
- which reclass-salt || {
- test -e /usr/share/reclass/reclass-salt && {
- ln -fs /usr/share/reclass/reclass-salt /usr/bin
- }
- }
-
configure_salt_master
echo -e "\nRestarting services ...\n"
@@ -475,12 +474,6 @@
curl -Lo /etc/init.d/salt-master https://anonscm.debian.org/cgit/pkg-salt/salt.git/plain/debian/salt-master.init && chmod 755 /etc/init.d/salt-master
ln -s /usr/local/bin/salt-master /usr/bin/salt-master
- which reclass-salt || {
- test -e /usr/share/reclass/reclass-salt && {
- ln -fs /usr/share/reclass/reclass-salt /usr/bin
- }
- }
-
configure_salt_master
echo -e "\nRestarting services ...\n"