From 84aa8ed4c64a160f0718c50fc02f260b857fbab5 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 1 May 2013 23:49:07 +0100 Subject: [PATCH] Fixed the destination path to where the pre-seed minions keys should be copied. --- ChangeLog | 3 ++- bootstrap-salt.sh | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b527eb8..55fe111 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ Version 1.5.5: - * Fixed a variable error in the new pressed feature. + * Fixed a variable error in the new pre-seed feature. + * Fixed the destination path to where the pre-seed minions keys should be copied. Version 1.5.4: diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 6c45bff..91a9784 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2459,11 +2459,18 @@ config_salt() { # preseed_master() { # Create the PKI directory - [ -d $PKI_DIR/minions ] || mkdir -p $PKI_DIR/minions && chmod 700 $PKI_DIR/minions || return 1 + + if [ $(ls $TEMP_KEYS_DIR | wc -l) -lt 1 ]; then + echoerror "No minion keys were uploaded. Unable to pre-seed master" + return 1 + fi + + SEED_DEST="$PKI_DIR/master/minions" + [ -d $SEED_DEST ] || mkdir -p $SEED_DEST && chmod 700 $SEED_DEST || return 1 for keyfile in $(ls $TEMP_KEYS_DIR); do src_keyfile="${TEMP_KEYS_DIR}/${keyfile}" - dst_keyfile="${PKI_DIR}/minions/${keyfile}" + dst_keyfile="${SEED_DEST}/${keyfile}" # If it's not a file, skip to the next [ ! -f $src_keyfile ] && continue