Skip to main content

Tools for writing awesome Fabric files

Project description

About

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.

Installing

To install the latest release from PyPI:

$ pip install fabtools

To install the latest development version from GitHub:

$ pip install git+git://github.com/ronnix/fabtools.git

Example

Here is an example fabfile.py using fabtools:

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

@task
def setup():

    # Require some Debian/Ubuntu packages
    require.deb.packages([
        'imagemagick',
        'libxml2-dev',
    ])

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

    # Require an email server
    require.postfix.server('example.com')

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

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

    # Require an nginx server proxying to our app
    require.nginx.proxied_site('example.com',
        docroot='/home/myuser/env/myapp/myapp/public',
        proxy_url='http://127.0.0.1:8888'
        )

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

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!

Changelog

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.

Source Distribution

fabtools-0.5.tar.gz (36.9 kB view details)

Uploaded Source

File details

Details for the file fabtools-0.5.tar.gz.

File metadata

  • Download URL: fabtools-0.5.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fabtools-0.5.tar.gz
Algorithm Hash digest
SHA256 1a9917988c81f4486000d456efff7d1112e97404f94f60b14b76f040ae063523
MD5 b0871507f0d66b670d4aa4a8b55d665b
BLAKE2b-256 16179390504d20eda3f20eaccc793464eda0db06d0225301694b6156c3984dd1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page