fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Deploying different things to different computers


From: Christian Vest Hansen
Subject: Re: [Fab-user] Deploying different things to different computers
Date: Wed, 13 Aug 2008 23:13:27 +0200

Well, you can cook up some funky stuff with the load() operation.

For instance, imagine this is you fabfile.py:

------------
set(spam_and_eggs = "Nobody expects the Spanish Inquisition!")

def hello():
  "Prints hello."
  local("echo Monty says: '$(spam_and_eggs)'")

def using(**kwargs):
    "Loads an external fabfile into our environment."
    a_fabfile = kwargs['fabfile']
    load(a_fabfile)
------------

Running $fab hello will give you:

------------
Running hello...
[localhost] run: echo Monty says: 'Nobody expects the Spanish Inquisition!'
Monty says: Nobody expects the Spanish Inquisition!
Done.
------------

Then suppose you have this in other_fabfile:

------------
set(spam_and_eggs='When danger reared its ugly head, he bravely turned
his tail and fled.')
------------

Now running "$ fab using:fabfile=other_fabfile hello" will give you:

------------
Running using...
Running hello...
[localhost] run: echo Monty says: 'When danger reared its ugly head,
he bravely turned his tail and fled.'
Monty says: When danger reared its ugly head, he bravely turned his
tail and fled.
Done.
------------

It could be argued that load() should become a command instead of an
operation, but currently this is what we got.




On Wed, Aug 13, 2008 at 10:22 PM, Jeff Forcier <address@hidden> wrote:
> On Wed, Aug 13, 2008 at 4:10 PM, Heikki Toivonen <address@hidden> wrote:
>> I started looking at Fabric to help me deploy an application that runs
>> on a group of different computers, with different operating systems all
>> needing different software installed. There are several environments
>> where this application needs to be installed, and there are of course
>> updates that need to be rolled out into all those environments, so an
>> automated solution would be needed.
>>
>> [...]
>>
>> A related problem I have is that when I need to deploy this application
>> in a different environment, the account names, login names, machine
>> names, directory structures etc. may change and I would not like to
>> create different fabfiles for different environments since the logic
>> does not change.
>>
>> [...]
>
> Hi Heikki,
>
> I don't have an immediate answer, except to say that I've seen this
> potential issue sort of loom on the horizon as I've been hacking on
> Fabric and starting to use it myself. I'm blessed with a *largely*
> homogenous Debian/Ubuntu environment, but there's enough of a
> CentOS/RHEL/OS X minority that I'll need to scratch this sort of itch
> myself eventually if it's not scratched by Christian or another
> hacker. So I'm pretty sure that someone in the nearish future will
> update Fabric so it's a bit easier to tweak the config at runtime /
> have a config-loading system like what you propose.
>
> Also, one tool you may or may not be aware of which tries to deal with
> this sort of problem in a BIG way is Puppet,
> http://reductivelabs.com/projects/puppet/ . I haven't migrated to it
> myself because I feel it's overkill for the sorts of smaller / less
> over-arching tasks I use Fabric for; but it sounds like a pretty good
> systematic approach to "doing the same thing on different types of
> systems" which is basically what the problem is.
>
> Regards,
> Jeff
>
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>



-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.




reply via email to

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