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 ...

Get Hands-On Enterprise Automation with Python. now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.