Skip to main content

A collection of fabric tools for working with DigitalOcean

Project description

https://travis-ci.org/andrewsomething/fabric-digitalocean.svg?branch=master

fabric-digitalocean is a collection of tools aiming to make it easy to use Fabric and DigitalOcean together.

It was inspired by fabric-aws

Installation

pip install fabric-digitalocean

Usage

With fabric-digitalocean, you can decorate Fabric tasks to run on a set of DigitalOcean Droplet. The @droplets decorator can take a list of Droplet IDs, a tag, or a region as an argument. If you use a tag or region, it will be expanded to a list of all Droplets with that tag applied or in that region. They can also be used together.

The environmental variable FABRIC_DIGITALOCEAN_TOKEN must contain a DigitalOcean API token.

See below for an example:

from fabric.api import task, run
from fabric_digitalocean.decorators import droplets


@task
@droplets(ids=[8043964, 7997777])
def task_by_ids():
    run('hostname')
    run('uptime')


@task
@droplets(tag='demo')
def task_by_tag():
    run('hostname')
    run('uptime')


@task
@droplets(region='nyc3')
def task_by_region():
    run('hostname')
    run('uptime')


@task
@droplets(region='nyc2', tag='demo')
def task_by_both():
    run('hostname')
    run('uptime')

Testing

To run the test suite, use:

nosetests -v --with-coverage --cover-package=fabric_digitalocean

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fabric_digitalocean-0.1-py2-none-any.whl (6.0 kB view details)

Uploaded Python 2

File details

Details for the file fabric_digitalocean-0.1-py2-none-any.whl.

File metadata

File hashes

Hashes for fabric_digitalocean-0.1-py2-none-any.whl
Algorithm Hash digest
SHA256 aab50abd06a05e6f052b5ad2da2de283570bbff985c9c1960e4e9d0ae3f776c9
MD5 a3a97e2b9a34e95820181d0b9b10363e
BLAKE2b-256 556f5ffb1dd66ea695fe806b1f0199129503df876041d7c2f3997c7bfc64c7d8

See more details on using hashes here.

Supported by

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