开发者

Fabric parallel task not bound to a specific set

开发者 https://www.devze.com 2023-03-18 03:48 出处:网络
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).

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消