How to install and use fabric in Ubuntu 9.10
From its website: "Fabric is a Python library and command-line tool that simplifies the use of SSH for application deployment or system management tasks." More specifically, the fabric is: A tool that allows you to execute arbitrary python functions from the command line; A subroutine library (above the lower level library) to execute shell commands easily and python via ssh.
Of course, most users combine these two things, using a cloth to write and execute Python functions or tasks, and automate interactions with remote servers. “
installation : Download package installation: sudo dpkg-i fabric*.deb
use :: Follow this brief tutorial to learn the basics. Create a file called fabfile.py please fill in your custom feature. For example:
From FABRIC.API import env, run, sudo
env.hosts = [' ubuntu1 ', ' ubuntu2 ', ' UBUNTU3 ']
Def upgrade_hosts ():
sudo (' apt-get update && apt-get dist-upgrade ')
Running Fabric: Fab upgrade_hosts
I think the fabric is very useful to save time and keep a similar server when you can design a task that will automatically run on all servers.