All Projects â†’ ansible-community â†’ molecule-hetznercloud

ansible-community / molecule-hetznercloud

Licence: LGPL-3.0 license
Molecule Hetzner Cloud driver 💀

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to molecule-hetznercloud

hcloud-pricing-exporter
A prometheus exporter for the current pricing and costs of your HCloud account
Stars: ✭ 19 (-9.52%)
Mutual labels:  hetzner, hetzner-cloud
hetzner.hcloud
A collection containing modules to manage resources on the Hetzner Cloud.
Stars: ✭ 58 (+176.19%)
Mutual labels:  hetzner, hetzner-cloud
minectl
minectl 🗺 is a cli for creating Minecraft server on different cloud provider.
Stars: ✭ 85 (+304.76%)
Mutual labels:  hetzner, hetzner-cloud
molecule-libvirt
Molecule LibVirt Provider
Stars: ✭ 35 (+66.67%)
Mutual labels:  molecule, molecule-driver
hetzner-rescaler
Lightweight CLI tool to programmatically rescale your Hetzner virtual server daily to optimize your budget spending
Stars: ✭ 44 (+109.52%)
Mutual labels:  hetzner, hetzner-cloud
ui-driver-hetzner
Rancher UI driver for the Hetzner Cloud docker driver.
Stars: ✭ 238 (+1033.33%)
Mutual labels:  hetzner, hetzner-cloud
hcloud-rust
Unofficial Rust crate for accessing the Hetzner Cloud API
Stars: ✭ 22 (+4.76%)
Mutual labels:  hetzner, hetzner-cloud
packer-builder-hcloud
Packer builder plugin for Hetzner Cloud - https://hetzner.cloud
Stars: ✭ 24 (+14.29%)
Mutual labels:  hetzner, hetzner-cloud
wireguard-setup
WireGuard and Unbound setup with Packer and Terraform.
Stars: ✭ 55 (+161.9%)
Mutual labels:  hetzner, hetzner-cloud
molecule-openstack
Molecule OpenStack Driver
Stars: ✭ 15 (-28.57%)
Mutual labels:  molecule, molecule-driver
hetzner-k3s
A Ruby gem (and Docker image) to install and manage Kubernetes clusters in Hetzner Cloud using the lightweight distribution k3s by Rancher.
Stars: ✭ 201 (+857.14%)
Mutual labels:  hetzner, hetzner-cloud
docker-volume-hetzner
Docker Volume Plugin for accessing Hetzner Cloud Volumes
Stars: ✭ 81 (+285.71%)
Mutual labels:  hetzner, hetzner-cloud
hcloud-ruby
Native ruby client for HetznerCloud
Stars: ✭ 29 (+38.1%)
Mutual labels:  hetzner, hetzner-cloud
molecule-ec2
molecule-ec2
Stars: ✭ 46 (+119.05%)
Mutual labels:  molecule, molecule-driver
CGCF-ConfGen
🧪 Learning Neural Generative Dynamics for Molecular Conformation Generation (ICLR 2021)
Stars: ✭ 41 (+95.24%)
Mutual labels:  molecule
keras-neural-graph-fingerprint
Keras implementation of Neural Graph Fingerprints as proposed by Duvenaud et al., 2015
Stars: ✭ 47 (+123.81%)
Mutual labels:  molecule
ansible-blackbox-exporter
Blackbox prober exporter
Stars: ✭ 60 (+185.71%)
Mutual labels:  molecule
ansible-role-fail2ban
Install and configure fail2ban on your system.
Stars: ✭ 42 (+100%)
Mutual labels:  molecule
xyz2graph
Convert an xyz file into a molecular graph and create a 3D visualisation of the graph.
Stars: ✭ 36 (+71.43%)
Mutual labels:  molecule
chemprop
Fast and scalable uncertainty quantification for neural molecular property prediction, accelerated optimization, and guided virtual screening.
Stars: ✭ 75 (+257.14%)
Mutual labels:  molecule

Molecule Hetzner Cloud Plugin

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.

Install

$ pip install molecule-hetznercloud

If you're looking for a container approach, see ansible-community/toolset.

Upgrade

Please see the CHANGELOG.md for migration guides.

$ pip install --upgrade molecule-hetznercloud

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 create a role using the driver plugin.

$ 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: instance
    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

Volume Handling

WARNING: this feature appears to be broke. See #24 for more

It is possible to have the driver manage volumes during the test run. You can add the following stanza to your Molecule configuration to have Molecule create this volume for the managed VPS. This volume will be cleaned up after use.

platforms:
  - name: instance
    server_type: cx11
    image: debian-10
    volumes:
      - name: "molecule-hetznercloud-volume-1-${INSTANCE_UUID}"
        location: /foo/bar
      - name: "molecule-hetznercloud-volume-2-${INSTANCE_UUID}"
        size: 20

Supported keys are:

  • name (required): name of volume
  • size (optional, default: 10GB): size of volume
  • location (optional, default: omitted): path for volume

Network Creation

This Driver is able to generate networks and subnetworks during the test run. This can be useful for cluster tests. You can create networks with the following snippet:

platforms:
  - name: instance1
    server_type: cx11
    image: debian-10
    networks:
      test-network:
        ip_range: 10.10.0.0/16
        subnet:
          ip: 10.10.10.1/24
          type: cloud
          network_zone: eu-central
      test-network-2:
        ip_range: 10.20.0.0/16
        subnet:
          ip: 10.20.10.1/24
  - name: instance2
    server_type: cx11
    image: debian-10
    networks:
      test-network:
        subnet:
          ip: 10.10.10.2/24

The networks ip_range is only important for creating. If you have multiple hosts, it is okay to only define ip_range once. The supported keys are:

  • networks

    • ip_range (required): ip range of network (usually /16)
  • subnet

    • ip (required): ip that should be assigned to host (also generates subnetwork) - prefix mandatory
    • type (optional, default: cloud): type of subnetwork
    • network_zone (optional, default: eu-central): network zone of subnetwork

Only use molecule.yml for configuration

It is being worked on that it is possible to remove all the files except the molecule.yml scenario file in your scenario directory. This is useful when you only require this plugin to do the default behaviour each time. It is also useful to reduce maintenance effort for migration of configurations. This plugin currently embeds the create.yml and destroy.yml playbooks. All other playbooks (e.g. prepare, cleanup) can be created as needed and Molecule will pick them up and run them. Embedding the converge.yml awaits this feature request.

Change log

See CHANGELOG.md.

Molecule Documentation

https://molecule.readthedocs.io

License

The LGPLv3 license.

Testing

Unit

$ pip install tox
$ tox -v

Integration

git clone https://github.com/ansible-community/molecule-hetznercloud.git
cd molecule-hetznercloud
python3 -m venv .venv && source .venv/bin/activate
pip install -e . "ansible<4" netaddr
export INSTANCE_UUID=$(openssl rand -hex 5)
export HCLOUD_TOKEN=YOURKEY
cd integration && molecule test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].