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:

  • Debian 6.0 (squeeze)

  • Ubuntu 10.04 (lucid)

  • Ubuntu 12.04 (precise)

  • RHEL 5/6

  • CentOS 5/6

  • Scientific Linux 5/6

  • SmartOS (Joyent)

Contributions to help support other Unix/Linux distributions are welcome!

Changelog

Version 0.12.0 (2013-03-04)

  • Do not create home directory for system users

  • Fix pkg.is_installed on SmartOS (thanks to Anthony Scalisi)

  • Fix system.get_arch (thanks to Kamil Chmielewski)

  • Add support for installing Oracle JDK (thanks to Kamil Chmielewski)

  • Add support for creating Postgres schemas (thanks to Michael Bommarito)

  • Fix mysql.user_exists (thanks to Serge Travin)

Version 0.11.0 (2013-02-15)

  • Fix requiring an existing user (thanks to Jonathan Peel)

  • Upgrade default Redis version to 2.6.10

  • Upgrade default Node.js version to 0.8.19

  • Better support for remote hosts where sudo is not installed

Version 0.10.0 (2013-02-12)

  • Enable/disable nginx sites (thanks to Sébastien Béal)

  • Add support for SmartOS (thanks to Anthony Scalisi)

  • Add support for RHEL/CentOS/SL (thanks to Anthony Scalisi)

Version 0.9.4 (2013-01-10)

  • Add files missing in 0.9.3 (thanks to Stéfane Fermigier)

Version 0.9.3 (2013-01-08)

  • Fix bugs in user creation (thanks pahaz and Stéphane Klein)

  • Add support for group creation

Version 0.9.2 (2013-01-05)

  • Add syntax highlighting in README (thanks to Artur Dryomov)

Version 0.9.1 (2013-01-04)

  • Fix documentation formatting issues

Version 0.9.0 (2013-01-04)

  • Improve user creation and modification

  • Add support for BSD / OS X to files.owner, files.group, files.mode and files.md5sum (thanks to Troy J. Farrell)

  • Improve PostgreSQL user creation (thanks to Troy J. Farrell and Axel Haustant)

  • Add reload and force_reload operations to the service module (thanks to Axel Haustant)

  • Fix missing import in require.redis (thanks to svevang and Sébastien Béal)

  • Add clear option to Python virtualenv (thanks to pahaz)

  • Upgrade default Redis version to 2.6.7

  • Upgrade default Node.js version to 0.8.16

  • Decrease verbosity of some operations

  • Speed up functional tests

Version 0.8.1 (2012-10-26)

  • Really fix pip version parsing issue

  • Upgrade default pip version to 1.2.1

Version 0.8.0 (2012-10-26)

  • Improve user module (thanks to Gaël Pasgrimaud)

  • Fix locale support on Debian (thanks to Olivier Kautz)

  • Fix version number in documentation (thanks to Guillaume Ayoub)

  • Fix potential issue with pip version parsing

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.

Source Distribution

fabtools-0.12.0.tar.gz (50.6 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for fabtools-0.12.0.tar.gz
Algorithm Hash digest
SHA256 c0ecdcbae656ff8180e01ff0dd03f4b4129a5a73855fc356debc5c56dbc58208
MD5 bf6f4d0157eed993515f177925b7d449
BLAKE2b-256 f90afc5b8ef2950aaadf8435eb3c08313f5d280ae02f6f8b55617e84d4bc61af

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