-
-
Save lusis/e5c78ba10da7020a83ab to your computer and use it in GitHub Desktop.
Like so: 'knife exec scripts/node_search.rb rolename environment'
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
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