Hi,
thanks for the input. Our setup on EC2 is structure so we can move
services
around. This is done by moving the IP and registering the host aliases
in DNS (dyndns).
Normally the host names and IPs do not overlap. But there are times...
And to
prevent capistrano from uploading and installing a release in parallel
on two hosts that are pointing to the identical address would be
asking for trouble,
wouldn't it?
I was looking for the code in capistraon where
a task collects all the hosts that the "run" command would be
executing on.
My patch would then resolve the hostnames and remove the duplicates.
So the resoultion of the hostname would be just before ssh would do it.
I will look into the role model to see if I can make better use of this.
But could you sketch at what classes to look if I'd like to patch the
"run" command
method so it will remove duplicates?
Thanks
Christian
On 28.05.2009, at 11:08, Lee Hambley wrote:
> Christian,
>
> I agree with Jamis, there're ways to do what you need that don't
> require altering anything about Capistrano's internals, it will just
> require you to rethink the structure of your tasks and role
> definitions a little; this might not fit well with the EC2
> extensions/code/tasks you are using, but we'll all be more than HTH.
>
> - Lee
>
> 2009/5/28 Jamis Buck <[email protected]>
>
> My recommendation: keep the host names distinct, and just use roles to
> indicate different purposes of identical hosts. Thus, you'd have
> "host1" in both the app and loadbalancer roles.
>
> Personally, I've used the fact that Capistrano does NOT resolve host
> names early. It's great for testing recipes, demoing (and debugging)
> Capistrano, etc. I'd hate to see that go away.
>
> - Jamis
>
> On Wed, May 27, 2009 at 5:45 PM, Christian van der Leeden
> <[email protected]> wrote:
> >
> > Hi,
> >
> > we're deploying on EC2 and to keep the setup clean we've
> defined host
> > aliase names.
> > E.g. app1 and app2 for the app servers, lb1 for loadbalancer 1 etc.
> >
> > Even though the names are different the hosts are sometimes the
> same.
> > E.g. load balancer
> > is also hosting the app server 1. On a deploy the code deploy would
> > now run in parallel
> > on the same host (lb1 and app1 who are identical).
> >
> > I'm looking for ideas on how to patch (or configure) capistrano to
> > prevent this situation.
> >
> > I imagine something along the lines of resolving the hostnames
> before
> > running a command
> > and then filtering out the duplicates. Is there an easy way to do
> > accomplish this?
> >
> > Thanks
> >
> > Christian
> >
> >
> > >
> >
>
>
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
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.co.uk/group/capistrano?hl=en
-~----------~----~----~----~------~----~------~--~---