Added ssh logic for auto accepting of keys

This commit is contained in:
Mike Reeves
2018-02-05 15:20:56 -05:00
parent fd02e4a754
commit e40f37679e

View File

@@ -107,11 +107,26 @@ if (whiptail --title "Security Onion Setup" --yesno "Are you sure you want to in
chown -R 939:939 /opt/so chown -R 939:939 /opt/so
# Add the grain
# Create the sls file
if [ $INSTALLTYPE == 'SENSORONLY' ]; then if [ $INSTALLTYPE == 'SENSORONLY' ]; then
#Do the grains file
service salt-minion start service salt-minion start
salt-call state.highstate 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 # They did not want to do the install
else else