This is an initial attempt at a Python module for BigV, with the eventual idea that this will be incorporated into an Ansible module.
This tool consumes the BigV REST API. The REST API is documented here (and its docs are on Github here), and depends on the python-requests module.
import bigv
act = bigv.BigVAccount(username="alice",password="testing",account="mystuff")
for m in act.machines():
print "Machine has %d discs" % len(list(m.discs()))
print m.info()
This repository now contains (possibly buggy) implementations of two Ansible
modules, bigv-disc
and bigv-vm
which are capable of creating new machines
and discs. Both modules are idempotent, but note that they will only ever
create and delete discs and VMs, and will never edit them.
Spec changes will need to be done manually.
A sample playbook is provided which shows basic usage of the two modules.
Since this is very much still in development, installation is a fairly manual process which allows you to pull changes from the git repo directly:
- Checkout the repo somewhere
- Install the Python module dependencies ('$ pip install -r requirements.txt')
- Create a symlink to the
bigv/
directory somewhere in the Python Path, you can check it works by runningpython -c 'import bigv'
and making sure it returns 0 - Create a
library/
directory in the same directory as your Ansible playbook, symlinkbigv-disc
andbigv-vm
into it.