From e00d3963c630e192ba5fdbc9c1ba77eb12786360 Mon Sep 17 00:00:00 2001 From: Denys Havrysh Date: Wed, 23 Nov 2016 10:33:52 +0200 Subject: [PATCH] Configure Minion ID and Master address prior to Salt installation --- bootstrap-salt.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 7f1ddc9..8fb5c2d 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -6304,7 +6304,21 @@ if [ "$CONFIG_SALT_FUNC" != "null" ] && [ "$_TEMP_CONFIG_DIR" != "null" ]; then fi fi -# Pre-Seed master keys +# Drop the master address if passed +if [ "$_SALT_MASTER_ADDRESS" != "null" ]; then + [ ! -d "$_SALT_ETC_DIR/minion.d" ] && mkdir -p "$_SALT_ETC_DIR/minion.d" + cat <<_eof > $_SALT_ETC_DIR/minion.d/99-master-address.conf +master: $_SALT_MASTER_ADDRESS +_eof +fi + +# Drop the minion id if passed +if [ "$_SALT_MINION_ID" != "null" ]; then + [ ! -d "$_SALT_ETC_DIR" ] && mkdir -p "$_SALT_ETC_DIR" + echo "$_SALT_MINION_ID" > "$_SALT_ETC_DIR/minion_id" +fi + +# Pre-seed master keys if [ "$PRESEED_MASTER_FUNC" != "null" ] && [ "$_TEMP_KEYS_DIR" != "null" ]; then echoinfo "Running ${PRESEED_MASTER_FUNC}()" $PRESEED_MASTER_FUNC @@ -6334,20 +6348,6 @@ if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then fi fi -# Drop the master address if passed -if [ "$_SALT_MASTER_ADDRESS" != "null" ]; then - [ ! -d "$_SALT_ETC_DIR/minion.d" ] && mkdir -p "$_SALT_ETC_DIR/minion.d" - cat <<_eof > $_SALT_ETC_DIR/minion.d/99-master-address.conf -master: $_SALT_MASTER_ADDRESS -_eof -fi - -# Drop the minion id if passed -if [ "$_SALT_MINION_ID" != "null" ]; then - [ ! -d "$_SALT_ETC_DIR" ] && mkdir -p "$_SALT_ETC_DIR" - echo "$_SALT_MINION_ID" > "$_SALT_ETC_DIR/minion_id" -fi - # Run any post install function. Only execute function if not in config mode only if [ "$POST_INSTALL_FUNC" != "null" ] && [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then echoinfo "Running ${POST_INSTALL_FUNC}()"