lib/capistrano/chef.rb in capistrano-chef-0.0.6 vs lib/capistrano/chef.rb in capistrano-chef-0.0.7

- old
+ new

@@ -50,10 +50,15 @@ options = {:attribute => :ipaddress, :limit => 1000}.merge(options) # Don't do the lookup if HOSTS is used. # Allows deployment from knifeless machine # to specific hosts (ie. developent, staging) unless ENV['HOSTS'] - role name, *(capistrano_chef.search_chef_nodes(query, options.delete(:attribute), options.delete(:limit)) + [options]) + hosts = capistrano_chef.search_chef_nodes(query, options.delete(:attribute), options.delete(:limit)) + [options] + if name.is_a?(Array) + name.each { |n| role n, *hosts } + else + role name, *hosts + end end end def set_from_data_bag(data_bag = :apps) raise ':application must be set' if fetch(:application).nil?