我的fab文件上有几个服务器, 我想有一个函数,它会提示我做什么,然后在所有服务器上执行它。你知道吗
def simple():
actions = prompt('Type the actions: ')
run(actions)
当我这么做的时候,我得到:
[web1] Type the actions:
bla bla bla
[web2] Type the actions:
bla bla bla
[web3] Type the actions:
bla bla bla
我只想输入一次“bla bla bla”,它将在所有服务器上执行, 有可能吗?你知道吗
如果
simple()
这里是一个Fabric任务,那么这种行为是预期的,因为您将对执行该任务的每个主机进行prompt()
调用。我想,您可以使用fab
命令行工具,在最简单的情况下:并按如下方式启动:
相关问题 更多 >
编程相关推荐