Thanks for sharing donnoman. I decided that using hosts wasn't for me.
The problem is that I actually want to sync to numerous roles. I've
(finally!) created this little script that forms the foundation for
doing what I want:

do_something() {

        APP_INSTANCES=$(ec2_listhosts ROLE_NAME)

        for instance in $APP_INSTANCES; do
                # do something with $instance
        done
}

This lets me get all the IP addresses of whatever you replace
ROLE_NAME with. I then intend to use that IP address as input into my
rsync command so I can push out changes to all my servers.

As an aside the reason I'm doing this is that after using GlusterFS I
found that it ran like a dog compared to a mounted EBS. It's most
likely something I've done wrong but after two days of trying to tune
gluster I've given up. On our site the difference in page load times
between using GlusterFS and EBS was about 2 seconds.



On Jun 1, 10:39 pm, donnoman <[email protected]> wrote:
> this is a little shell script I use to easily list or ssh to roles.
> Needs some help if there are multiples of each roles, but should be
> enough to get you started.
>
> #!/bin/sh
> if [ -z "$1" ]; then
>   find /etc/aws/hosts/*/* | cut -f 5-6 -d "/"
> else
>   ssh `find /etc/aws/hosts/$1*/* | cut -f 6 -d "/"`
> fi
>
> There's also a ruby example buried somewhere in the docs.
>
> You can also see a capistrano/ruby example in the enum task 
> here:http://groups.google.com/group/scalr-discuss/web/scalr-with-capistrano
>
> On Jun 1, 12:20 pm, "[email protected]"
>
>
>
> <[email protected]> wrote:
> > Hi,
>
> > Is there any way of retrieving a list of app instances within a given
> > farm from a shell script? I want to rsync files from a central server
> > to each instance of my app within the farm, obviously as the farm
> > scales and grows it will be necessary to sync to more instances.
>
> > Could anyone advise whether this is possible? I guess it must be
> > possible somehow because the www role must "detect" which app roles
> > are available to load balance to them, I essentially want to do the
> > same thing with rsync. It's probably a custom role in its own right
> > for my uses.
>
> > TIA.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"scalr-discuss" 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/scalr-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to