host.roles
を叩くと、role(のSymbol)のSetが返ってくる。
task :foo do on release_roles :all do |host| host.roles #=> #<Set: {:web, :app, :db}> end end
git_strategy
の中でもcontext
を通して同じことができる。
set :git_strategy, MyGitStrategy module MyGitStrategy def release context.host.roles #=> #<Set: {:web, :app, :db}> end end