scalr_hosts['foo'] is just a simple hash

you can see how it's populated from here; specifically the :enum task

namespace :scalr do
    desc "Enumerate SCALR hosts"
    task :enum, :roles=>[:db],  :only => { :primary => true } do
      hosts =
Hash.new <----------------------------------------------------------
      logger.info "SCALR Hosts:"
      run 'find /etc/aws/hosts | cut -d"/" -f5,6 | grep "/"', :pty =>
true do |ch, stream, out|
        next if out.chomp == ''
        logger.info out.sub(/\//,' ')
        out.split("\r\n").each do |host|
          host=host.split("/")
          (hosts[host[0]] ||= []) << host[1]
        end
      end
      if hosts['mysql'].size > 1
        hosts['mysql'] = hosts['mysql'] - hosts['mysql-master']
      end
      set :scalr_hosts, hosts
<---------------------------------------------------------
    end
end

here's another adaptation:

https://github.com/threetee/capistrano-scalr/blob/master/lib/capistrano-scalr.rb

On Sat, Mar 5, 2011 at 4:49 AM, Robin Bowes <robin-li...@robinbowes.com>wrote:

> On 05/03/11 03:08, Donovan Bray wrote:
> > You can look here for an example
> >
> > http://groups.google.com/group/scalr-discuss/web/scalr-with-capistrano
> >
>
> Donovan,
>
> Can you explain how "scalr_hosts['foo']" works?
>
> R.
> --
> "Feed that ego and you starve the soul" - Colonel J.D. Wilkes
> http://www.theshackshakers.com/
>
> --
> * You received this message because you are subscribed to the Google Groups
> "Capistrano" group.
> * To post to this group, send email to capistrano@googlegroups.com
> * To unsubscribe from this group, send email to
> capistrano+unsubscr...@googlegroups.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 capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to