set :config_role, :app set :config_path, -> { release_path } set :config_type, 'json' namespace :config do task :setup do config_role = fetch(:config_role) config_path = fetch(:config_path) config_type = fetch(:config_type) on roles(config_role) do |server| # stage = fetch(:stage) execute "cd #{config_path} && cp config.#{server.hostname}.#{config_type} config.#{config_type}" end end end