Created
December 18, 2012 14:38
-
-
Save cwood/4328540 to your computer and use it in GitHub Desktop.
restart all salt minions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SALTMINIONS=$(sudo salt-key -L | grep -v "Rejected:" | grep -v "Accepted Keys:" | grep -v "Unaccepted Keys:") | |
echo -n "Remote hosts [sudo] password: " | |
read -s remote_password | |
echo | |
for minion in $SALTMINIONS | |
do | |
echo "Connecting to $minion ... " | |
ssh -tt $minion "echo \"$remote_password\" | sudo -S -p '' /etc/init.d/salt-minion restart" | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment