Capistrano 3 Ship Password

I have the following capistrano 3 task:

desc 'Add root scheduled tasks'
task :root_schedules do
  on roles(:all) do 
    within release_path do
      execute :sudo, :bundle, 'exec whenever -w config/root_schedule.rb -u root'
    end
  end
end

I need this task to run with sudo privileges because I need scheduled tasks to run with higher privileges. These are basic server tasks. The problem is that every time I run this command, I get the following:

DEBUG [46d3800c]    [sudo] password for [user]

After I type in my password and press Enter, it never completes anything. No reaction at all. Are there any answers?

+4
source share
2 answers

I just created a stone for this purpose: sshkit-sudo

  • Add gem 'sshkit-sudo'to Gemfile
  • Add require 'sshkit/sudo'to Capfile

sudo Capistrano 3.

+9

Capistrano kinda , sudoers, , .

: capistrano, , -login, . , , , , . .

0

All Articles