Thanks for sharing your ssh-bootstrap.sh script. I'd like to suggest the attached patch (also copied inline below). It simply modifies the stable branch to not use 4 separate SSH connections, and use a single SSH connection, with each command set run in a sub-shell. If the command succeeds, the next one will be executed.
This saves on SSH setup overhead, particularly if you have a new environment and DNS isn't setup (when SSH is using DNS).
--- ssh-bootstrap.sh 2014-04-11 06:42:23.000000000 -0700
+++ ssh-bootstrap-sg.sh 2014-04-11 06:42:23.000000000 -0700
@@ -81,11 +81,13 @@
shift $((OPTIND-1))
+_Options="-i ${_Sssh_Key} ${_Target}"
+
# If your bootstrap-salt.sh script is from the develop branch
-ssh -i ${_Ssh_Key} ${_Target} sudo bash -s -- < bootstrap-salt.sh -X -A ${_Master_Name} -i ${_Minion_Name}
+ssh ${_Options} sudo bash -s -- < bootstrap-salt.sh -X -A ${_Master_Name} -i ${_Minion_Name}
# If your bootstrap-salt.sh script is from the stable branch
-#ssh -i ${_Ssh_Key} ${_Target} sudo bash -s -- < bootstrap-salt.sh -X -A ${_Master_Name}
-#ssh -i ${_Ssh_Key} ${_Target} sudo sed -i "s/\#id\:/id:\ ${_Minion_Name}/g" /etc/salt/minion
-#ssh -i ${_Ssh_Key} ${_Target} sudo service salt-minion stop
-#ssh -i ${_Ssh_Key} ${_Target} sudo service salt-minion start
+#ssh ${_Options} " ( sudo bash -s -- < bootstrap-salt.sh -X -A ${_Master_Name} ) &&
+# ( sudo sed -i "s/\#id\:/id:\ ${_Minion_Name}/g" /etc/salt/minion ) &&
+# ( sudo service salt-minion stop ) &&
+# ( sudo service salt-minion start ) "