Skip to content

Instantly share code, notes, and snippets.

@lusis
Created July 26, 2011 16:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lusis/e5c78ba10da7020a83ab to your computer and use it in GitHub Desktop.
Save lusis/e5c78ba10da7020a83ab to your computer and use it in GitHub Desktop.
Like so: 'knife exec scripts/node_search.rb rolename environment'
role = ARGV[2]
env = ARGV[3]
results = []
search(:node, "role:#{role} AND chef_environment:#{env}") do |n|
results << n.ec2.public_hostname
end
puts results.join(" ")
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment