Skip to main content

Tools for writing awesome Fabric files

Project description


fabtools includes useful functions to help you write your Fabric files.

fabtools makes it easier to manage system users, packages, databases, etc.

fabtools includes a number of low-level actions, as well as a higher level interface called fabtools.require.

Using fabtools.require allows you to use a more declarative style, similar to Chef or Puppet.


To install the latest release from PyPI:

$ pip install fabtools

To install the latest development version from GitHub:

$ pip install git+git://


Here is an example using fabtools:

from fabric.api import *
from fabtools import require
import fabtools

def setup():

    # Require some Debian/Ubuntu packages

    # Require a Python package
    with fabtools.python.virtualenv('/home/myuser/env'):

    # Require an email server

    # Require a PostgreSQL server
    require.postgres.user('myuser', 's3cr3tp4ssw0rd')
    require.postgres.database('myappsdb', 'myuser')

    # Require a supervisor process for our app
        command='/home/myuser/env/bin/gunicorn_paster /home/myuser/env/myapp/production.ini',

    # Require an nginx server proxying to our app

    # Setup a daily cron task
    fabtools.cron.add_daily('maintenance', 'myuser', '')

Supported targets

fabtools currently supports the following target operating systems:

  • Ubuntu 10.04 (lucid)
  • Ubuntu 12.04 (precise)
  • Debian 6.0 (squeeze)

Contributions to help support other Linux distributions are welcome!


Version 0.7.0 (2012-10-13)

  • Fix changed directory owner requirement (thanks to Troy J. Farrell)
  • Add functions to get a file’s owner, group and mode

Version 0.6.0 (2012-10-13)

  • Add support for Node.js (thanks to Frank Rousseau)
  • Fix dependency on Fabric >= 1.4.0 (thanks to Laurent Bachelier)

Version 0.5.1 (2012-09-21)

  • Documentation and packaging fixes

Version 0.5 (2012-09-21)

  • The watch context manager now allows you to either provide a callback or do an explicit check afterwards (warning: this change is not backwards compatible, please update your fabfiles)
  • Add support for some network-related operations:
    • get the IPV4 address assigned to an interface
    • get the list of name server IP addresses
  • The services module now supports both upstart and traditional SysV-style /etc/init.d scripts (thanks to Selwin Ong)
  • The virtualenv context manager can now also be used with local() (thanks to khorn)
  • The supervisor module now uses update instead of reload to avoid unnecessary restarts (thanks to Dan Fairs)
  • Add support for OpenVZ containers (requires a kernel with OpenVZ patches)
  • pip can now use a download cache
  • Upgrade Redis version to 2.4.17
  • Misc bug fixes and improvements
  • Support for Ubuntu 12.04 LTS and Debian 6.0
  • Documentation improvements

Version 0.4 (2012-05-30)

  • Added support for requiring an arbitrary APT source
  • Added support for adding APT signing keys
  • Added support for requiring a user with a home directory
  • Added vagrant helpers
  • Fixed Python virtualenv context manager

Version 0.3.2 (2012-03-19)

  • Fixed README formatting

Version 0.3.1 (2012-03-19)

  • Fixed bug in functional tests runner

Version 0.3 (2012-03-19)

  • Added support for Shorewall (Shoreline Firewall)
  • Fixed Python 2.5 compatibility
  • Refactored tests

Version 0.2.1 (2012-03-09)

  • Packaging fixes

Version 0.2 (2012-03-09)

  • Added support for hostname and sysctl (kernel parameters)
  • Added support for Redis
  • Simplified API for supervisor processes

Version 0.1.1 (2012-02-19)

  • Packaging fixes

Version 0.1 (2012-02-19)

  • Initial release

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for fabtools, version 0.7.0
Filename, size File type Python version Upload date Hashes
Filename, size fabtools-0.7.0.tar.gz (39.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page