Skip to content
This repository has been archived by the owner on May 20, 2022. It is now read-only.

Commit

Permalink
Merge branch 'base_doc'
Browse files Browse the repository at this point in the history
  • Loading branch information
ioO committed Oct 18, 2017
2 parents 2c17066 + 5b278bf commit e258619
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 78 deletions.
69 changes: 5 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,13 @@
Testible
========

An example how to test playbooks and roles with virtualbox vms
[![Documentation Status](https://readthedocs.org/projects/testible/badge/?version=latest)](http://testible.readthedocs.io/en/latest/?badge=latest)

Quick start
-----------
Playbooks to start and stop virtualbox vms and test your playbooks.

1. Copy testible-playbook.yml file in your ansible projet in the same
folder than your playbooks.
2. Set variables host vars for localhost and virtualbox vm host
3. Run this command
```shell
ansible-playbook testible-playbook.yml --extra-vars='{"vm": "name of vm", "snapshot": "name of snapshot", "playbook": "name of playbook"}'
```
Test playbook use **localhost** host. It sets the vm at the snapshot and
launch the vm. It includes your playbook defined in *playbook* extra
vars.

You need to define vm and snapshot uuid, it is explained below.

Configure localhost
-------------------

First you need virtualbox and install at least one vm.

Based on [ansible best
practices](http://docs.ansible.com/ansible/playbooks_best_practices.html),
this example use the directory layout. So variables needed for localhost
are located on *host\_vars/localhost*. The file is commented. The
testible playbook can sit along your project playbook.

The script need your local user in var to configure *$HOME/.ssh/config*
file. The playbook add an entry for the test vm at the start and delete
the entry when it quits.
```yaml
host:
user:
local: name of your local user
```

Configure vm
Useful links
------------

For each vm choose a name. Add it to your inventory file and define
variables in *host\_vars/name\_of\_hosts*.

To get your vm uuid, run :
```shell
$ VBoxManage list vms
```

In your host var file add this var
```yaml
host:
vbox:
uuid: vmuuid
```
To get your vm snapshots, run :
```shell
$ VBoxManage snapshot vmuuid list
```
In your host var file add this var.
```yaml
host:
name: your host name
vbox:
uuid: vbox_uuid
snapshots:
bare_minimal: snapshotuuid
```
Take a look at host\_vars files ;)
[Documentation](http://testible.readthedocs.io/en/latest/)
[Issue tracking](https://github.com/ioO/testible/issues)
80 changes: 66 additions & 14 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,72 @@
.. Testible documentation master file, created by
sphinx-quickstart on Wed Oct 18 14:08:49 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Testible
========

Welcome to Testible's documentation!
====================================
An example how to test playbooks and roles with virtualbox vms

.. toctree::
:maxdepth: 2
:caption: Contents:
Quick start
-----------

1. Copy testible-playbook.yml file in your ansible projet in the same
folder than your playbooks.
2. Set variables host vars for localhost and virtualbox vm host
3. Run this command
```shell
ansible-playbook testible-playbook.yml --extra-vars='{"vm": "name of vm", "snapshot": "name of snapshot", "playbook": "name of playbook"}'
```
Test playbook use **localhost** host. It sets the vm at the snapshot and
launch the vm. It includes your playbook defined in *playbook* extra
vars.

You need to define vm and snapshot uuid, it is explained below.

Indices and tables
==================
Configure localhost
-------------------

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
First you need virtualbox and install at least one vm.

Based on [ansible best
practices](http://docs.ansible.com/ansible/playbooks_best_practices.html),
this example use the directory layout. So variables needed for localhost
are located on *host\_vars/localhost*. The file is commented. The
testible playbook can sit along your project playbook.

The script need your local user in var to configure *$HOME/.ssh/config*
file. The playbook add an entry for the test vm at the start and delete
the entry when it quits.
```yaml
host:
user:
local: name of your local user
```

Configure vm
------------

For each vm choose a name. Add it to your inventory file and define
variables in *host\_vars/name\_of\_hosts*.

To get your vm uuid, run :
```shell
$ VBoxManage list vms
```

In your host var file add this var
```yaml
host:
vbox:
uuid: vmuuid
```
To get your vm snapshots, run :
```shell
$ VBoxManage snapshot vmuuid list
```
In your host var file add this var.
```yaml
host:
name: your host name
vbox:
uuid: vbox_uuid
snapshots:
bare_minimal: snapshotuuid
```
Take a look at host\_vars files ;)

0 comments on commit e258619

Please sign in to comment.