Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
88ffc62389 | |||
d98183e095 | |||
03671f5ead | |||
33e2a4f2bf | |||
10d26d1518 | |||
d2d548b166 | |||
837de64be9 | |||
5786a60678 | |||
671e92cd0b | |||
dfb003fdcb | |||
a2ee39a2f0 | |||
9164e92d38 | |||
5f57fb2c95 | |||
3a1602382a | |||
5179b284ba | |||
218073759f | |||
a25533d917 |
31
.drone.yml
31
.drone.yml
@ -7,6 +7,9 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- pip install tox==3.14.6
|
- pip install tox==3.14.6
|
||||||
- tox -e linters
|
- tox -e linters
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- "refs/heads/master"
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
@ -17,6 +20,11 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- pip install tox==3.14.6
|
- pip install tox==3.14.6
|
||||||
- tox -e packaging
|
- tox -e packaging
|
||||||
|
depends_on:
|
||||||
|
- linters
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- "refs/heads/master"
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
@ -27,6 +35,11 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- pip install tox==3.14.6
|
- pip install tox==3.14.6
|
||||||
- tox -e py36
|
- tox -e py36
|
||||||
|
depends_on:
|
||||||
|
- linters
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- "refs/heads/master"
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
@ -37,6 +50,11 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- pip install tox==3.14.6
|
- pip install tox==3.14.6
|
||||||
- tox -e py37
|
- tox -e py37
|
||||||
|
depends_on:
|
||||||
|
- linters
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- "refs/heads/master"
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
@ -47,6 +65,11 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- pip install tox==3.14.6
|
- pip install tox==3.14.6
|
||||||
- tox -e py38
|
- tox -e py38
|
||||||
|
depends_on:
|
||||||
|
- linters
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- "refs/heads/master"
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
@ -58,6 +81,11 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- pip install tox==3.14.6
|
- pip install tox==3.14.6
|
||||||
- tox -e devel
|
- tox -e devel
|
||||||
|
depends_on:
|
||||||
|
- linters
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- "refs/heads/master"
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
@ -79,3 +107,6 @@ depends_on:
|
|||||||
- py36
|
- py36
|
||||||
- py37
|
- py37
|
||||||
- py38
|
- py38
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- "refs/heads/master"
|
||||||
|
19
CHANGELOG.md
19
CHANGELOG.md
@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.2.2] - 2020-06-15
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- Point to an open issue tracker
|
||||||
|
|
||||||
|
## [0.2.1] - 2020-04-29
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Pinned Molecule to avoid issues with `sh` dependency.
|
||||||
|
|
||||||
|
## [0.2.0] - 2020-04-27
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Add bundled playbooks so as to reduce required configuration on end-user side
|
||||||
|
- Added an internal `molecule.yml` so that `molecule init role` can get good defaults (will work with Molecule >= 3.0.4)
|
||||||
|
|
||||||
## [0.1.0] - 2020-04-27
|
## [0.1.0] - 2020-04-27
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
20
README.md
20
README.md
@ -24,6 +24,7 @@ any financial support from RedHat or Hetzner Cloud for this work.
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
You need to expose a `HCLOUD_TOKEN` environment variable in your environment.
|
You need to expose a `HCLOUD_TOKEN` environment variable in your environment.
|
||||||
|
|
||||||
Find out more about how to get one of those [over here](https://docs.hetzner.cloud/#overview-authentication).
|
Find out more about how to get one of those [over here](https://docs.hetzner.cloud/#overview-authentication).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -46,7 +47,7 @@ dependency:
|
|||||||
driver:
|
driver:
|
||||||
name: hetznercloud
|
name: hetznercloud
|
||||||
platforms:
|
platforms:
|
||||||
- name: my-instance-name
|
- name: instance
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: debian-10
|
image: debian-10
|
||||||
provisioner:
|
provisioner:
|
||||||
@ -71,6 +72,17 @@ $ export MOLECULE_NO_LOG=False # not so verbose, helpful
|
|||||||
$ export MOLECULE_DEBUG=True # very verbose, last ditch effort
|
$ export MOLECULE_DEBUG=True # very verbose, last ditch effort
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 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](https://github.com/ansible-community/molecule/issues/2675).
|
||||||
|
|
||||||
## Mirroring
|
## Mirroring
|
||||||
|
|
||||||
Issues will be responded to on both issue trackers.
|
Issues will be responded to on both issue trackers.
|
||||||
@ -98,16 +110,16 @@ The [LGPLv3](https://www.gnu.org/licenses/lgpl-3.0.en.html) license.
|
|||||||
|
|
||||||
This is all done on our [drone.autonomic.zone](https://drone.autonomic.zone/autonomic-cooperative/molecule-hetznercloud) setup.
|
This is all done on our [drone.autonomic.zone](https://drone.autonomic.zone/autonomic-cooperative/molecule-hetznercloud) setup.
|
||||||
|
|
||||||
Unit tests and such.
|
### Unit
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ pip install tox
|
$ pip install tox
|
||||||
$ tox -v
|
$ tox -v
|
||||||
```
|
```
|
||||||
|
|
||||||
Integration tests.
|
### Integration
|
||||||
|
|
||||||
(Only doable by [Autonomic Cooperative](https://autonomic.zone/) members.)
|
Only doable by [Autonomic Cooperative](https://autonomic.zone/) members.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo apt install -y direnv
|
$ sudo apt install -y direnv
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"molecule_directory": "molecule",
|
"molecule_directory": "molecule",
|
||||||
"role_name": "OVERRIDDEN",
|
"role_name": "OVERRIDDEN",
|
||||||
"scenario_name": "OVERRIDDEN"
|
"scenario_name": "OVERRIDDEN"
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
dependency:
|
||||||
|
name: galaxy
|
||||||
|
driver:
|
||||||
|
name: hetznercloud
|
||||||
|
platforms:
|
||||||
|
- name: "{{ cookiecutter.role_name }}"
|
||||||
|
server_type: cx11
|
||||||
|
image: debian-10
|
||||||
|
provisioner:
|
||||||
|
name: ansible
|
||||||
|
lint: |
|
||||||
|
set -e
|
||||||
|
yamllint .
|
||||||
|
ansible-lint .
|
@ -98,3 +98,8 @@ class HetznerCloud(Driver):
|
|||||||
"account API token value"
|
"account API token value"
|
||||||
)
|
)
|
||||||
sysexit_with_message(msg)
|
sysexit_with_message(msg)
|
||||||
|
|
||||||
|
def reset(self):
|
||||||
|
"""Destroy all resources managed by this plugin."""
|
||||||
|
# TODO(decentral1se): implement if ever needed
|
||||||
|
pass
|
||||||
|
@ -54,13 +54,15 @@
|
|||||||
|
|
||||||
- name: Populate instance config dict
|
- name: Populate instance config dict
|
||||||
set_fact:
|
set_fact:
|
||||||
instance_conf_dict: {
|
instance_conf_dict:
|
||||||
'instance': "{{ item.hcloud_server.name }}",
|
{
|
||||||
'ssh_key_name': "{{ ssh_key_name }}",
|
"instance": "{{ item.hcloud_server.name }}",
|
||||||
'address': "{{ item.hcloud_server.ipv4_address }}",
|
"ssh_key_name": "{{ ssh_key_name }}",
|
||||||
'user': "{{ ssh_user }}",
|
"address": "{{ item.hcloud_server.ipv4_address }}",
|
||||||
'port': "{{ ssh_port }}",
|
"user": "{{ ssh_user }}",
|
||||||
'identity_file': "{{ ssh_path }}", }
|
"port": "{{ ssh_port }}",
|
||||||
|
"identity_file": "{{ ssh_path }}",
|
||||||
|
}
|
||||||
with_items: "{{ hetzner_jobs.results }}"
|
with_items: "{{ hetzner_jobs.results }}"
|
||||||
register: instance_config_dict
|
register: instance_config_dict
|
||||||
when: server.changed | bool
|
when: server.changed | bool
|
@ -8,7 +8,7 @@ universal = 1
|
|||||||
name = molecule-hetznercloud
|
name = molecule-hetznercloud
|
||||||
url = https://git.autonomic.zone/autonomic-cooperative/molecule-hetznercloud
|
url = https://git.autonomic.zone/autonomic-cooperative/molecule-hetznercloud
|
||||||
project_urls =
|
project_urls =
|
||||||
Bug Tracker = https://git.autonomic.zone/autonomic-cooperative/molecule-hetznercloud/issues
|
Bug Tracker = https://github.com/ansible-community/molecule-hetznercloud/issues
|
||||||
CI: Drone = https://drone.autonomic.zone/autonomic-cooperative/molecule-hetznercloud/
|
CI: Drone = https://drone.autonomic.zone/autonomic-cooperative/molecule-hetznercloud/
|
||||||
Source Code = https://git.autonomic.zone/autonomic-cooperative/molecule-hetznercloud
|
Source Code = https://git.autonomic.zone/autonomic-cooperative/molecule-hetznercloud
|
||||||
description = Molecule Hetzner Cloud Plugin :: run molecule tests with hetzner cloud
|
description = Molecule Hetzner Cloud Plugin :: run molecule tests with hetzner cloud
|
||||||
@ -53,12 +53,12 @@ setup_requires =
|
|||||||
setuptools_scm_git_archive >= 1.1
|
setuptools_scm_git_archive >= 1.1
|
||||||
install_requires =
|
install_requires =
|
||||||
hcloud >= 1.6.3, < 2
|
hcloud >= 1.6.3, < 2
|
||||||
molecule >= 3.0.3, <= 3.1
|
molecule >= 3.0.4, <= 3.1
|
||||||
pyyaml >= 5.3.1, < 6
|
pyyaml >= 5.3.1, < 6
|
||||||
|
|
||||||
[options.extras_require]
|
[options.extras_require]
|
||||||
test =
|
test =
|
||||||
hcloud >= 1.6.3
|
hcloud >= 1.6.3, < 2
|
||||||
mock >= 4.0.2, < 5
|
mock >= 4.0.2, < 5
|
||||||
pytest-cov >= 2.8.1, < 3
|
pytest-cov >= 2.8.1, < 3
|
||||||
pytest-helpers-namespace >= 2019.1.8, < 2020
|
pytest-helpers-namespace >= 2019.1.8, < 2020
|
||||||
|
Reference in New Issue
Block a user