Reputation: 3869
I want to use an array to assign roles in Capistrano.
instances=ENV['deploy_hosts'].split ','
role :web, instances
("Undefined method match for array", blah blah blah)
instances=ENV['deploy_hosts'].split ','
role :web, *instances
("Connection failed for host1,host2" - duh, they're an ARRAY)
How do I do this?
Upvotes: 1
Views: 652
Reputation: 7779
i'm not pretty sure but try:
instances=ENV['deploy_hosts'].split ','
instances.each do |instance|
role :web, instance
end
Upvotes: 4