Class: Annex::List
Instance Method Summary collapse
Methods inherited from Command
Constructor Details
This class inherits a constructor from Annex::Command
Instance Method Details
#execute ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/annex/list.rb', line 3 def execute which = servers.select do |server| name_tag = server.["Name"] name_tag = name_tag.gsub(/-i-[0-9a-f]+$/, '') rescue '' choose = server.state == "running" choose = choose && name_tag =~ /^#{role}/ if role choose = choose && name_tag =~ /#{environment}$/ if environment choose end which.each do |server| @env.info(server.["Name"], :info) @env.info(" #{server.dns_name}\n Public: #{server.public_ip_address}\n Private: #{server.private_ip_address}\n", :notice) end end |