Skip to main content

Molecule Hetzner Cloud Plugin :: run molecule tests with hetzner cloud

Project description

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

  • Ping @decentral1se on the #ansible-molecule channel on Freenode.

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

Project details


Download files

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

Source Distribution

molecule-hetznercloud-0.1.0.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

molecule_hetznercloud-0.1.0-py2.py3-none-any.whl (27.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file molecule-hetznercloud-0.1.0.tar.gz.

File metadata

  • Download URL: molecule-hetznercloud-0.1.0.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.0

File hashes

Hashes for molecule-hetznercloud-0.1.0.tar.gz
Algorithm Hash digest
SHA256 98c081ed8146379a442a3f3a02d64d62ea5aa26b7b399eedb46f66d8f446a30d
MD5 300586d239023f7e95101db5224e7515
BLAKE2b-256 3e28148ebf3756c214579a31c296d57c45702b2bff79b598d95d994299d297f7

See more details on using hashes here.

File details

Details for the file molecule_hetznercloud-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: molecule_hetznercloud-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.0

File hashes

Hashes for molecule_hetznercloud-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 07d2df4fdd66f9e771910f866da137a71e0888e0467e29c24d08269aec887f0c
MD5 605eab099da7519f182ccc2c6c06e9d5
BLAKE2b-256 0cbeea4ffbb5198a1025fcda3da4aa9e00fefdc0d982288662536d7187722842

See more details on using hashes here.

Supported by

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