fabric/fabric

 fabric / fabric

fabric / fabric

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

fabric866086608664866486688668867286728676867686808680868486848688868886928692869686962017-06-122017-06-132017-06-142017-06-152017-06-162017-06-172017-06-182017-06-192017-06-202017-06-212017-06-222017-06-232017-06-242017-06-252017-06-26fabric86608.34650851448199.565737722017-06-12866438.1554674948178.9707183472017-06-13866567.964426475173.8219635042017-06-14866697.7733854553168.6732086612017-06-158668127.582344436158.3756989752017-06-168671157.391303416142.9294344452017-06-178674187.200262396127.4831699162017-06-188680217.00922137696.59064085712017-06-198686246.81818035765.69811179832017-06-208690276.62713933745.10309242582017-06-218694306.43609831724.50807305332017-06-228693336.24505729829.65682789642017-06-238695366.05401627819.35931821022017-06-248697395.8629752589.061808523912017-06-258698425.6719342383.913053680782017-06-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.)