Created
April 17, 2012 21:04
-
-
Save efuquen/2409042 to your computer and use it in GitHub Desktop.
Lists all the nodes that fall under a specified role
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/bash | |
function search_node { | |
NODE_ROLES=$(knife node show $1 | grep Roles | grep $2) | |
if [ "" != "$NODE_ROLES" ] | |
then | |
echo "$1" | |
fi | |
} | |
NODE_LIST=$(knife node list) | |
for NODE in $NODE_LIST | |
do | |
search_node $NODE $1& | |
done | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment