From e40f37679e93569bbfc15ad8a1f7ebfb2702ca80 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Mon, 5 Feb 2018 15:20:56 -0500 Subject: [PATCH] Added ssh logic for auto accepting of keys --- so-setup-network.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/so-setup-network.sh b/so-setup-network.sh index 0f37d0ca1..5f8c43ff6 100644 --- a/so-setup-network.sh +++ b/so-setup-network.sh @@ -107,11 +107,26 @@ if (whiptail --title "Security Onion Setup" --yesno "Are you sure you want to in chown -R 939:939 /opt/so + # Add the grain + # Create the sls file if [ $INSTALLTYPE == 'SENSORONLY' ]; then + + #Do the grains file + service salt-minion start salt-call state.highstate - # Script to accept key on the master + touch /tmp/$HOSTNAME.sls + echo "sensor:" > /tmp/$HOSTNAME.sls + echo " interface: bond0" >> /tmp/$HOSTNAME + echo " lbprocs: $LBPROCS" >> /tmp/$HOSTNAME + # SCP the pillar file to the master + scp /tmp/$HOSTNAME.sls socore@$MASTERSRV:/opt/so/saltstack/pillar/sensors/ + + # Accept the key on the master + ssh socore@$MASTERSRV 'sudo salt-key -qa $HOSTNAME' + + fi # They did not want to do the install else