diff --git a/pillar/data/addtotab.sh b/pillar/data/addtotab.sh index 619f1722f..a07dac0ea 100644 --- a/pillar/data/addtotab.sh +++ b/pillar/data/addtotab.sh @@ -15,18 +15,6 @@ MONINT=$9 #NODETYPE=$10 #HOTNAME=$11 -if [ ! -d $local_salt_dir/pillar/data/ ]; then - mkdir -p $local_salt_dir/pillar/data/ -fi - -# Create the template -if [ ! -f $local_salt_dir/pillar/data/$TYPE.sls ]; then - printf '%s\n'\ - "$TYPE:"\ - "" > "$local_salt_dir/pillar/data"/$TYPE.sls - echo "Added $TYPE Template" -fi - echo "Seeing if this host is already in here. If so delete it" if grep -q $NAME "$local_salt_dir/pillar/data/$TYPE.sls"; then echo "Node Already Present - Let's re-add it" diff --git a/setup/so-functions b/setup/so-functions index f6970d791..0923fb137 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -56,6 +56,21 @@ add_master_hostfile() { whiptail_check_exitstatus $exitstatus } +addtotab_generate_templates() { + + local addtotab_path=$local_salt_dir/pillar/data + mkdir -p "$addtotab_path" + + for i in evaltab mastersearchtab mastertab nodestab sensorstab + do + printf '%s\n'\ + "$i:"\ + "" > "$addtotab_path"/$i.sls + echo "Added $i Template" + done + +} + # $5 => (optional) password variable so_add_user() { local username=$1 diff --git a/setup/so-setup b/setup/so-setup index 9ddb35a0a..919283237 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -405,6 +405,7 @@ fi salt_checkin >> $setup_log 2>&1 if [[ $is_master || $is_helix ]]; then + addtotab_generate_templates >> $setup_log 2>&1 set_progress_str 25 'Configuring firewall' set_initial_firewall_policy >> $setup_log 2>&1