fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] Running commands on multiple servers in a command


From: Peter Sheats
Subject: Re: [Fab-user] Running commands on multiple servers in a command
Date: Wed, 20 May 2009 13:27:44 -0400

I don't think it works...  I tried it briefly and it didn't.  It seems to me that the connection is made to the server before the command is run and the connection is not closed until the command finishes.

There would have to be a way to close the connection, connect to another server, run the command and then do the same again.

Peter

On Wed, May 20, 2009 at 1:06 PM, Jorge Vargas <address@hidden> wrote:
On Thu, May 14, 2009 at 4:06 PM, Jeff Forcier <address@hidden> wrote:
> On Thu, May 14, 2009 at 9:46 AM, Peter Sheats <address@hidden> wrote:
>> Maybe this is possible but I'm not understanding how to do this.
>>
>> Server 1 is the webserver
>> Server 2 is the media server
>>
>> My deployment strategy requires doing something on both to deploy.  However,
>> what i do on Server 2 is dependent on information I find from Server 1.
>>
>> I want to run 'fab live deploy' and do the following:
>>
>> def deploy():
>>     run("stuff on server1")
>>     value = run("value based on info from Server 1")
>>     # now, based on value from server 1
>>     run("commands on server2")
>>     #whole project successfully deployed now
>>
>> Am I not understanding something or is this use-case not supported?
>
> I assume you're referring to 0.9, correct me if I'm wrong :)
>
> The default execution model is simply "obtain host list for given task
> function, run function once per host". I wrote down some ideas in the
> project's TODO list for ways to update this, since I definitely want
> things to be more flexible in this area.
>
> However, all that really matters to run() or sudo() is that
> env.host_string is defined, so you can currently do something like
> this (ensuring not to set the host list on the command line or in your
> fabfile):
>
> def deploy():
>    env.host_string = 'server1'
>    run("stuff on server1"
>    value = run("/get/my/value --please")
>    env.host_string = 'server2'
>    run("stuff on server2")
>
Awesome recipe it should be documented on sphinx? I wanted to switch
host at runtime too.

> While I haven't explicitly tested this exact usage out, it *should* work.
>
> -Jeff
>
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]