Hi everyone,
I've recently started using Fabric (any Python for that matter)! So far I'm loving Fabric compared to Capistrano, which is next to useless outside of Ruby projects that I can tell.
I have hit a snag with Fabric though, and I'm surprised nobody else seems to have dealt with it. I've got sets of nodes that comprise an 'environment'. For example, 2 boxes are used as db servers, 2 boxes as application servers (not exactly my setup, but that's the idea).
Now I can have 2 tasks for this with @host decorators that map the hosts to the deployment logic, however, since there is no way to change the hosts within a task, I have to make 2 separate calls to fab on the CLI.
The problem is, I have several sets of nodes and the order of operations in the deployment is itself some logic I would like to encapsulate. Best approach I have so far is to place the fab calls into a BASH script.
I'm shocked that there's no way to change hosts within a task, and moreover that this desire hasn't arisen before. Is there some way to change the hosts mid-task? I can't find anything on Google or Stackoverflow. Or am I thinking about this the wrong way? Seems like grouping the hosts the way I have makes sense. I took a look at roles, but I don't think that's any different than say an @host decorator with the 'db' servers for example.
Your help appreciated!
thanks,
-nathan