fabtools

Tools for writing awesome Fabric files

Github星跟蹤圖

About

fabtools includes useful functions to help you write your Fabric <http://fabfile.org/>_ 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 <http://pypi.python.org/pypi/fabtools>_

.. code-block:: console

$ pip install fabtools

To install the latest development version from GitHub <https://github.com/ronnix/fabtools>_

.. code-block:: console

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

Example

Here is an example fabfile.py using fabtools

.. code-block:: python

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:

  • full support:

    • Debian family:

      • Debian 6 (squeeze), 7 (wheezy), 8 (jessie)
      • Ubuntu 10.04 (lucid), 12.04 (precise), 14.04 (trusty)
  • partial support:

    • RedHat family:

      • RHEL 5/6
      • CentOS 5/6
      • Scientific Linux 5/6
      • Fedora
    • Arch Linux, Manjaro Linux

    • Gentoo

    • SmartOS (Joyent)

Contributions to help improve existing support and extend it to other
Unix/Linux distributions are welcome!

主要指標

概覽
名稱與所有者fabtools/fabtools
主編程語言Python
編程語言Python (語言數: 1)
平台
許可證BSD 2-Clause "Simplified" License
所有者活动
創建於2011-09-05 01:44:24
推送於2019-12-13 07:52:20
最后一次提交2019-09-16 11:19:00
發布數30
最新版本名稱0.20.0 (發布於 2016-10-12 12:37:32)
第一版名稱0.1 (發布於 )
用户参与
星數1.3k
關注者數42
派生數206
提交數0.9k
已啟用問題?
問題數142
打開的問題數78
拉請求數142
打開的拉請求數26
關閉的拉請求數63
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?