2

我的场景:

Local host -> Gateway -> Remote host

我已经尝试过网关选项:

fab -g user@host task

但它不起作用。有人有说明和提示吗?

这是详细信息:

xdays@localhost:~/Public/fabric$ fab hello
[vps.xdays.info] Executing task 'hello'
[vps.xdays.info] run: echo Hello!
[vps.xdays.info] out: Hello!
[vps.xdays.info] out: 


Done.
Disconnecting from vps.xdays.info... done.

xdays@localhost:~/Public/fabric$ vim fabfile.py

xdays@localhost:~/Public/fabric$ fab hello
[vps.xdays.info] Executing task 'hello'
[vps.xdays.info] run: echo Hello!
[vps.xdays.info] Login password for 'root': 
[vps.xdays.info] Login password for 'root': 
Stopped.
xdays@localhost:~/Public/fabric$ cat fabfile.py
from fabric.api import local, run, env

env.gateway = 'xdays@localhost'
env.user = 'root'
env.hosts = ['vps.xdays.info']
env.password = 'password'

def hello(name='world'):
    '''just hello'''
    run('echo Hello!')
4

0 回答 0