Skip to content

Instantly share code, notes, and snippets.

@silviabotros
Created September 17, 2013 22:08
Show Gist options
  • Save silviabotros/6601384 to your computer and use it in GitHub Desktop.
Save silviabotros/6601384 to your computer and use it in GitHub Desktop.
all-chef-servers
#!/usr/bin/env bash
set -eu
DEFAULT_SERVER=$(knife block list | grep '\[ Currently Selected \]' | awk '{ print $2 }')
ALL_SERVERS=$(knife block list | grep '*' | awk '{ print $2 }')
for SERVER in $ALL_SERVERS; do
knife block use $SERVER
$*
done
knife block use $DEFAULT_SERVER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment