Thanks for the response, Rafael. Sure thing.
Executing that task with two nodes assigned to ":test_role" produced
the following...
* executing `role_with_several_servers'
* executing "uptime"
servers: ["ap-1", "ap-2"]
Enter passphrase for /home/devuser/.ssh/id_dsa: Enter passphrase for /
home/devuser/.ssh/id_dsa:
snip[...]
Enter passphrase for /home/devuser/.ssh/id_dsa:
connection failed for: ap-2 (OpenSSL::PKey::DSAError: Neither PUB key
nor PRIV key:: nested asn1 error), ap-1 (NoMethodError: undefined
method `overwrite' for nil:NilClass)
However, if I use ssh-agent to cache my passphrase, the task is
successful...
* executing `role_with_several_servers'
* executing "uptime"
servers: ["ap-1", "ap-2"]
[ap-1] executing command
[ap-2] executing command
** [out :: ap-2] 19:28:28 up 8 days, 18:54, 0 users, load average:
0.00, 0.00, 0.00
** [out :: ap-1] 19:28:28 up 8 days, 18:55, 1 user, load average:
0.16, 0.08, 0.02
command finished
If I then remove my passphrase from the cache, and run the same task
with only one node assigned (role :test_role, "ap-1"), it's
successful...
* executing `role_with_several_servers'
* executing "uptime"
servers: ["ap-1"]
Enter passphrase for /home/devuser/.ssh/id_dsa: <passphrase
successfully entered here>
[ap-1] executing command
** [out :: ap-1] 19:32:30 up 8 days, 18:59, 1 user, load average:
0.07, 0.04, 0.00
command finished
The short-term solution seems to be to keep my passphrase cached
(despite the security implications).
~ jeremy
On Sep 29, 11:51 am, Rafael García <[email protected]> wrote:
> I read badly your firsts emails, so sorry.
>
> Could you test this task?
>
> role :test_role, "ap-1", "ap-2"
>
> desc "Execute task in all servers of a role"
> task :role_with_several_servers, :roles => :test_role do
> run "uptime"
> end
>
> I executed it locally and worked fine. I'm trying to know why happen it.
>
>
>
> On Wed, Sep 29, 2010 at 7:54 PM, jeyroz <[email protected]> wrote:
> > The gentleman in the following StackOverflow post seems to have
> > experienced the same issue, however no helpful (permanent) resolution
> > exists...
>
> >http://stackoverflow.com/questions/2718314/capistrano-fails-for-multi...
>
> > Specifying the following does indeed allow all deployments to run
> > successfully, but the passphrase does need to be repeated for each
> > node.
> > default_run_options[:max_hosts] = 1
>
> > Using "ssh-agent" to cache my key passphrase alleviates the annoyance,
> > but only really covers up the core issue (about which I'm still
> > clueless).
>
> > Best,
>
> > ~ j
>
> > On Sep 29, 9:52 am, jeyroz <[email protected]> wrote:
> > > Thanks for the suggestion Rafael. I attempted that as well (various
> > > formats actually) but to no avail.
>
> > > role :app, %w{ap-1, ap-2}
> > > role :app, ["ap-1", "ap-2"]
>
> > > Passing the nodes in as an array actually kicks back the following
> > > error...
> > > /path/to/gems/1.9.1/gems/capistrano-2.5.19/lib/capistrano/
> > > server_definition.rb:16:in `initialize': undefined method `match' for
> > > ["ap-1", "ap-2"]:Array (NoMethodError)
>
> > > Which led me to disregard the suggestion as I had seen several
> > > different documented examples of ways to pass the nodes into "role".
> > > The syntax I chose came from the docs below (also linked to from your
> > > provided URI)...
>
> > > -- Fromhttp://
> > rdoc.info/github/capistrano/capistrano/master/Capistrano/Confi...
> > > --
> > > Usage:
> > > snip[...]
> > > role :app, "app1.example.com", "app2.example.com"
> > > -- End --
>
> > > That format seems to work (almost), aside from the pesky passphrase
> > > requests and subsequent failure.
> > > Am I missing something obvious?
>
> > > Best,
>
> > > ~ jeremy
>
> > > On Sep 29, 7:39 am, Rafael García <[email protected]> wrote:
>
> > > > Try to write it as array[1].
>
> > > > role :app, ["ap-1", "ap-2"]
>
> > > > Regards
>
> > > > [1]http://wiki.github.com/capistrano/capistrano/roles
>
> > > > On Wed, Sep 29, 2010 at 4:09 PM, jeyroz <[email protected]> wrote:
> > > > > To further clarify my deploy.rb example, the three "role" assignments
> > > > > at the end have been applied exclusively. The final entry in the list
> > > > > is the one that doesn't work.
>
> > > > > # role :app, "ap-1" # <= works
> > > > > # role :app, "ap-2" # <= works
> > > > > role :app, "ap-1", "ap-2" # <= doesn't work
>
> > > > > Thanks for the help and input.
>
> > > > > ~ jeremy
>
> > > > > On Sep 28, 6:21 pm, jeyroz <[email protected]> wrote:
> > > > > > Hello, I recently began experimenting with Capistrano. Deploying
> > our
> > > > > > codebase to a single server (role :app, "ap-1") worked well, but
> > once
> > > > > > I included a secondary application server to the list (role :app,
> > > > > > "ap-1", "ap-2"), things went sideways...
>
> > > > > > * executing `deploy:setup'
> > > > > > * executing "snip[...]"
> > > > > > servers: ["ap-1", "ap-2"]
> > > > > > Enter passphrase for /home/devuser/.ssh/id_dsa: Enter passphrase
> > for /
> > > > > > home/devuser/.ssh/id_dsa:
>
> > > > > > You'll note the duplicate requests for a ssh-key "passphrase" in
> > > > > > succession. When provided, I'm prompted for it again, and again. If
> > I
> > > > > > simply [enter] through the process numerous times, I receive the
> > > > > > following...
>
> > > > > > connection failed for: ap-1 (OpenSSL::PKey::DSAError: Neither PUB
> > key
> > > > > > nor PRIV key:: nested asn1 error), ap-2 (NoMethodError: undefined
> > > > > > method `overwrite' for nil:NilClass)
>
> > > > > > Passphrase protected DSA keys are used to quickly log-in between
> > all
> > > > > > of our servers. The "devuser" above has a public key registered as
> > an
> > > > > > "authorized_key" with the "deployuser" used to deploy the
> > application
> > > > > > on each server. The keys are set up appropriately and have been
> > > > > > verified. Again, I can successfully deploy to either server
> > > > > > individually using the users/keys in question, without issue, but
> > not
> > > > > > both at once.
>
> > > > > > My deploy.rb file is embarrassingly simple at this point...
>
> > > > > > set :application, "appname"
> > > > > > set :repository, "http://domain.com/svn/appname/"
> > > > > > set :user, "deployuser"
> > > > > > set :use_sudo, false
> > > > > > set :scm, :subversion
> > > > > > set :scm_username, "svnuser"
> > > > > > set :scm_password, "svnpass"
> > > > > > set :deploy_to, "/path/to/#{application}"
> > > > > > role :app, "ap-1" # <= works
> > > > > > role :app, "ap-2" # <= works
> > > > > > role :app, "ap-1", "ap-2" # <= doesn't work
>
> > > > > > Any ideas where I have gone wrong at such an early stage?
>
> > > > > > Thanks for the help.
>
> > > > > > Best,
>
> > > > > > ~ jeremy
>
> > > > > --
> > > > > * You received this message because you are subscribed to the Google
> > Groups
> > > > > "Capistrano" group.
> > > > > * To post to this group, send email to [email protected]
> > > > > * To unsubscribe from this group, send email to
> > > > > [email protected]<capistrano%2bunsubscr...@googlegrou
> > > > > ps.com>
> > <capistrano%2bunsubscr...@googlegrou ps.com>For more options, visit this
> > group at
> > > > >http://groups.google.com/group/capistrano?hl=en
>
> > --
> > * You received this message because you are subscribed to the Google Groups
> > "Capistrano" group.
> > * To post to this group, send email to [email protected]
> > * To unsubscribe from this group, send email to
> > [email protected]<capistrano%2bunsubscr...@googlegrou
> > ps.com>For more options, visit this group at
> >http://groups.google.com/group/capistrano?hl=en
--
* You received this message because you are subscribed to the Google Groups
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/capistrano?hl=en