What is Fabric?
Fabric (http://www.fabfile.org/) is a high-level Python library that is used to connect to remote servers (through the paramiko library) and execute predefined tasks on them. It runs a tool called fab on the machine that hosts the fabric module. This tool will look for a fabfile.py
file, located in the same directory that you run the tool in. The fabfile.py
file contains your tasks, defined as a Python function that is called from the command line to start the execution on the servers. The Fabric tasks themselves are just normal Python functions, but they contain special methods that are used to execute commands on remote servers. Also, at the beginning of fabfile.py
, you need to define some environmental variables, such as the remote hosts, username, password, and any other variables needed during execution:

Installation
Fabric requires Python 2.5 to 2.7. You can install Fabric and all of its dependencies using pip
, or you can use a system package manager, such as yum
or apt...