Are these capistrano tasks being executed on all roles ?!?


I have an Apache front-end web server “server1”, an application server
with Ruby and Thin “server2”, and a MySQL database server “server3”.
Before I do a deployment I wanted to check what Capistrano is going to
do to each server so I’ve been digging around the default recipes in the
source code.

If I’m not mistaken, it seems that a lot of recipes are needlessly
running on all three servers when the recipe only needs to be run on the
application server. For instance here is the deploy:setup task:

task :setup, :except => { :no_release => true } do
dirs = [deploy_to, releases_path, shared_path]
dirs += { |d| File.join(shared_path, d) }
run “#{try_sudo} mkdir -p #{dirs.join(’ ‘)} && #{try_sudo} chmod g+w
#{dirs.join(’ ')}”

Since it doesn’t have a :roles parameter, it would seem this is going to
run on all three servers even though server1 and server3 won’t need
these directories and won’t need the application files copied to them
(which the update_code task is also needlessly running on all three
servers) when this task should only run on server2. By the default it
looks like my application structure will be copied to three servers even
though it’s only used on one.

So why don’t these default to just running on the server(s) in the :app