In the previous chapter, we used the subprocess module to run and spawn a system process inside the machine that hosted our Python script, and to return the output back to the Terminal. However, many automation tasks require access to remote servers to execute commands, which is not easy to do using a sub-process. This becomes a piece of cake with the use of another Python module: Fabric. The library makes connections to remote hosts and executes different tasks, such as uploading and downloading files, running commands with specific user IDs, and prompting users for input. The Fabric Python module is a robust tool for administrating dozens of Linux machines from a central point.
The following topics will be covered in this chapter:
- What is Fabric?
- Executing your first Fabric file
- Other useful Fabric features