Can a Python Fabric task invoke other tasks and respect their hosts lists?
Since Fabric 1.3, the execute helper is now available to do just this. The documentation is available here: Intelligently executing tasks with execute. Here is the example they use: from fabric.api import run, roles, execute env.roledefs = { ‘db’: [‘db1’, ‘db2’], ‘web’: [‘web1’, ‘web2’, ‘web3’], } @roles(‘db’) def migrate(): # Database stuff here. pass @roles(‘web’) … Read more