On Fri, Mar 4, 2011 at 4:48 PM, Chris Patti <[email protected]> wrote: > On Fri, Mar 4, 2011 at 3:59 PM, Lee Hambley <[email protected]> wrote: >> Chris, >> This isn't perfect - but is effectively what you are trying to do >> - https://github.com/leehambley/capistrano-yaml-multistage >> I can't remember if the current master there runs out of the box… but >> there's not a lot of code, and it's pretty light on magic. >> - HTH, Lee >> > > Thanks Lee. > > So, reading through your code, it looks like the salient bit is: > > puts "Setting role of #{role_key} to #{role_value}" > role(role_key.to_sym, role_value.to_s) > > Can you please tell me where the role() routine is defined? Should I > just call this in my custom task? > > Based on another example: > > http://groups.google.com/group/scalr-discuss/web/scalr-with-capistrano > > I tried adding a role definition like he did, which has inside of the > role :web do block the array I generated in my task, but then I get > the exception I include in full below. > > I've put the entire deploy.rb into a pastie: > > http://pastie.org/1634110 > > Thanks for any clues. > > -Chris
[stacktrace snip. Sorry for breaking the ground rules folks :)] OK, nailed it. Turns out I was making this way more complex than it needed to be. After a re-read of the DSL docs: https://github.com/capistrano/capistrano/wiki/2.x-DSL-Configuration-Roles-Role I found that all I needed to do was put my JSON querying code that returns a list of servers into a function, and then: role(:web) do compute_serverlist end Simple! Thanks everyone. -Chris -- Christopher Patti - Geek At Large | GTalk: [email protected] | AIM: chrisfeohpatti | P: (260) 54PATTI "Technology challenges art, art inspires technology." - John Lasseter, Pixar -- * 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
