I'm looking for a way to define a task with multirun, which will run on a set of servers defined in the commandline (via roles or hosts).
All examples I've seen so far, try to do something like:
env('app-nodes').multirun('some command')
But I don't want to hardcode the role. I'd like to define it with fab -R ...
inste开发者_高级运维ad. What are my options here?
I'd expect this to work:
@task
def some_task():
env().multirun('some command')
but that throws TypeError: '_AttributeDict' object is not callable
You'll prolly want to use task args and feed it into tav's env() that way: http://docs.fabfile.org/en/1.1.1/usage/fab.html#per-task-arguments
Also why would you expect an empty set for hosts to work?
精彩评论