fabric/fabric

 fabric / fabric

fabric / fabric

Simple, Pythonic remote execution and deployment. http://fabfile.org

fabric8550855085608560857085708580858085908590860086002017-05-132017-05-142017-05-152017-05-162017-05-172017-05-182017-05-192017-05-202017-05-212017-05-222017-05-232017-05-242017-05-252017-05-26fabric85448.34650851448196.5824051752017-05-13854440.4484643394196.5824051752017-05-14855372.5504201643166.685436842017-05-158562104.652375989136.7884685042017-05-168567136.754331814120.1790416512017-05-178572168.856287639103.5696147982017-05-188575200.95824346493.60395868662017-05-198575233.06019928993.60395868662017-05-208580265.16215511476.99453183372017-05-218589297.26411093947.09756349842017-05-228595329.36606676427.16625127492017-05-238599361.46802258913.87870979252017-05-248601393.5699784137.234939051372017-05-258602425.6719342383.913053680782017-05-26star

 README

Fabric is a Python (2.5-2.7) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks.

It provides a basic suite of operations for executing local or remote shell commands (normally or via sudo) and uploading/downloading files, as well as auxiliary functionality such as prompting the running user for input, or aborting execution.

Typical use involves creating a Python module containing one or more functions, then executing them via the fab command-line tool. Below is a small but complete "fabfile" containing a single task:

from fabric.api import run

def host_type():
    run('uname -s')

If you save the above as fabfile.py (the default module that fab loads), you can run the tasks defined in it on one or more servers, like so:

$ fab -H localhost,linuxbox host_type
[localhost] run: uname -s
[localhost] out: Darwin
[linuxbox] run: uname -s
[linuxbox] out: Linux

Done.
Disconnecting from localhost... done.
Disconnecting from linuxbox... done.

In addition to use via the fab tool, Fabric's components may be imported into other Python code, providing a Pythonic interface to the SSH protocol suite at a higher level than that provided by e.g. the Paramiko library (which Fabric itself uses.)