I do not wish to use sudo for any of my remotely executed commands via Capistrano. Specifically, when I run cap deploy:setup
, I'm asked for my sudo password during the first mkdir
command. I added set :use_sudo, false
to my deploy.rb file, but this did not make a difference.
I started with a fairly complete deploy.rb file, but whittled it down once I started having issues. Here is my minimal version that still shows use_sudo
not being respected:
# App Definitions
set :domain, '[server-ip]'
role :app, domain
role :web, domain
role :db, domain, :primary => true
set :user, "my_app"
set :use_sudo, false
task :sudo_test do
run "#{try_sudo} whoami"
end
running cap sudo_test
results in me being prompted for my sudo password. What am I missing here (besides the hair I've already pulled out)?
Google Findings
https://groups.google.com/forum/?fromgroups#!topic/capistrano/QNYnvW8obrg
A thread with someone having a similar issue. No conclusion/resolution noted in the thread.
#{try_sudo}
bit? what if you take it out? – Filagree#{try_sudo}
should sudoize the command if:use_sudo
is set tofalse
. I include it insudo_test
because the capistrano rails tasks likely use it as well, and is likely where the problem stems from. – Corottocap deploy:setup
is trying to use sudo when I don't want it to.cap deploy:setup
is a pre-baked recipe; I'm not looking to modify it. Rather, I need to determine why the option:use_sudo
isn't working. – Corottosudo
. – Corotto