Created
August 14, 2015 20:32
-
-
Save mjhb/4b5255adcabb03086d62 to your computer and use it in GitHub Desktop.
Execute puppet run on a list of remote hosts, when puppet daemon is not available
This file contains 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/sh | |
LOG="puppet.log.`date +%Y-%m-%d.%H-%M-%S`" | |
OPTS="--server puppet.server.com --onetime --no-daemonize --verbose --detailed-exitcodes --color false" | |
while read HOST; do | |
echo "*** Processing $HOST" | tee -a $LOG | |
ssh -oBatchMode=yes -n $HOST "sudo puppet agent $OPTS 2>&1" 2>&1 | tee -a $LOG | |
done < hosts.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment