Molecule Hetzner Cloud driver plugin
Go to file
Luke Murphy 3a1602382a
Some checks reported errors
continuous-integration/drone/push Build was killed
Appease linter with spacing
2020-04-27 15:25:00 +02:00
.github Add missing header 2020-04-26 00:57:33 +02:00
integration Add bundled playbooks 2020-04-27 15:20:47 +02:00
molecule_hetznercloud Appease linter with spacing 2020-04-27 15:25:00 +02:00
.drone.yml Add other py versions for testing 2020-04-27 13:07:01 +02:00
.envrc.sample Fixup envrc.sample with missing env var 2020-04-24 14:38:24 +02:00
.gitignore Testing configuration cleanup 2020-04-24 10:45:20 +01:00
.pre-commit-config.yaml Fix linters 2020-04-24 14:19:38 +02:00
.yamllint.yml Remove Molecule project cruft 2020-04-24 14:41:40 +02:00
CHANGELOG.md Add bundled playbooks 2020-04-27 15:20:47 +02:00
LICENSE Relicense to LGPL 2020-04-24 12:22:29 +02:00
Makefile Remove cruft and shorten dir name 2020-04-24 15:09:25 +02:00
pyproject.toml Shape up package configuration and update deps 2020-04-24 13:24:38 +02:00
pytest.ini Ignore those warnings 2019-11-16 08:05:55 +07:00
README.md Add missing 's' 2020-04-26 21:07:06 +02:00
setup.cfg Allow py36 in setuptools requires 2020-04-27 13:07:18 +02:00
setup.py Testing configuration cleanup 2020-04-24 10:45:20 +01:00
tox.ini Add other py versions for testing 2020-04-27 13:07:01 +02:00

Molecule Hetzner Cloud Plugin

Drone CI-CD PyPI Package Repository License

A Hetzner Cloud plugin for Molecule.

This plugin allows you to do molecule init role myrolename -d hetznercloud and have Molecule provision on-demand Hetzner Cloud VPSes of your choice for your integration testing. New VPSes will be automagically created and provisioned on each molecule test run, SSH keys are generated and managed internally and all resources are cleaned up regardless of whether the role under test succeeds or fails.

Support

If you use this plugin in a commercial setting or you find it personally useful, please support my maintenance work financially through my Liberapay profile or through my Github Sponsor profile. I do not receive any financial support from RedHat or Hetzner Cloud for this work.

Usage

You need to expose a HCLOUD_TOKEN environment variable in your environment. Find out more about how to get one of those over here.

$ export HCLOUD_TOKEN=mycoolapitoken

Then install the required Python package.

$ pip install molecule-hetznercloud
$ molecule init role myrolename -d hetznercloud

Your myrolename/molecule/default/molecule.yml should then look like the following.

---
dependency:
  name: galaxy
driver:
  name: hetznercloud
platforms:
  - name: my-instance-name
    server_type: cx11
    image: debian-10
provisioner:
  name: ansible
verifier:
  name: ansible

Please see docs.hetzner.cloud for information regarding images and server types.

Then just run the role.

$ cd myrolename && molecule test

To ease initial debugging for getting things started, also expose the following environment variables.

$ export MOLECULE_NO_LOG=False  # not so verbose, helpful
$ export MOLECULE_DEBUG=True  # very verbose, last ditch effort

Mirroring

Issues will be responded to on both issue trackers.

Change log

See CHANGELOG.md.

Molecule Documentation

https://molecule.readthedocs.io

Contact

License

The LGPLv3 license.

Testing

This is all done on our drone.autonomic.zone setup.

Unit tests and such.

$ pip install tox
$ tox -v

Integration tests.

(Only doable by Autonomic Cooperative members.)

$ sudo apt install -y direnv
$ cp .envrc.sample .envrc
$ direnv allow
$ pip install -e .
$ cd integration-test-role && molecule test