I use fabric2
in terminal and I don't want input -H 'hosts'
every time.
How can I do it?
e.g.
// actual
fab2 -H web1 upload_and_unpack
// expected
fab2 upload_and_unpack
I've read the main doc, configuration doc but found nothing.
I use fabric2
in terminal and I don't want input -H 'hosts'
every time.
How can I do it?
e.g.
// actual
fab2 -H web1 upload_and_unpack
// expected
fab2 upload_and_unpack
I've read the main doc, configuration doc but found nothing.
from fabric import task
@task(hosts=['web1'])
def upload_and_unpack(c):
c.run('uname -a')
If you define your fabfile as above, then you can simple run your fab command without providing any host parameter (assuming that web1 is already defined in your ssh config file).
$ fab upload_and_unpack