title: Capistrano 3: Run task only on a single server from a pool of servers assigned a role
body: <p>I have 20 servers that are in the "web" role.  I have a task I need to perform on only one of them as the change affects shared storage.  My current solution is a hack to get around this (below).  Looking for a better way, I don't have a ton of ruby or cap experience.</p>
  
  <pre><code>task :checkout_project_properties do
      num_runs = 0
      on roles(:web), in: :sequence do
          if num_runs &gt; 0
              abort('Only running on one server.  Exiting')
          end
          execute("checkout-project-properties #{uc_stage} #{repo} #{branch}")
          num_runs += 1
      end
  end
  </code></pre>