Created
January 31, 2014 01:20
-
-
Save gene1wood/8724901 to your computer and use it in GitHub Desktop.
A parallel ssh command which checks the last chef run and runs it again if there was a problem.
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
# `get_hosts $stack` returns the ips of the instances in the named stack | |
# the "-t -t" extra-args works around the issue of running sudo without a tty | |
# the "--force-formatter" tells chef-solo to still output what it's doing even though it has no tty | |
stack=1234 | |
pssh --host="`get_hosts $stack`" --timeout=0 --inline --par=10 --extra-args='-t -t -o StrictHostKeyChecking=no' --user=ec2-user 'if tail -1 /var/log/chef.log | grep FATAL; then sudo chef-solo -c /etc/chef/solo.rb -j /etc/chef/node.json --force-formatter; fi' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment