Compare commits
17 Commits
add-networ
...
ef8c7e3381
Author | SHA1 | Date | |
---|---|---|---|
ef8c7e3381 | |||
8bf5ca3ed2 | |||
6427696ce4
|
|||
f9f989cf58
|
|||
f43a697629
|
|||
e479213a6e
|
|||
f7f843539d
|
|||
5180ae639d
|
|||
9831d31ed8
|
|||
060d2ad829
|
|||
3b75e39241
|
|||
79567304dd | |||
a1669c0b04 | |||
cfdb264fe5 | |||
534b1427f2
|
|||
2e9f4b8f06
|
|||
87c3b71df5
|
16
CHANGELOG.md
16
CHANGELOG.md
@ -7,11 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [1.2.1] - 2021-06-02
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Remove async task handling for network deletion ([#30](https://github.com/ansible-community/molecule-hetznercloud/pull/30), credit @ggggut)
|
||||||
|
|
||||||
|
## [1.2.0] - 2021-06-02
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Allow to create networks during test runs ([#29](https://github.com/ansible-community/molecule-hetznercloud/pull/29), thanks @ggggut!)
|
||||||
|
|
||||||
## [1.1.0] - 2021-03-30
|
## [1.1.0] - 2021-03-30
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
|
||||||
- Relaxed bounds on Molecule to allow all versions < v4 ([#27](https://github.com/ansible-community/molecule-hetznercloud/pull/27))
|
- Relaxed bounds on Molecule to allow all versions less than `v4` ([#27](https://github.com/ansible-community/molecule-hetznercloud/pull/27))
|
||||||
|
|
||||||
## [1.0.0] - 2021-01-06
|
## [1.0.0] - 2021-01-06
|
||||||
|
|
||||||
@ -29,7 +41,7 @@ tracker so that we can mention them here.
|
|||||||
|
|
||||||
## [0.2.2] - 2020-06-15
|
## [0.2.2] - 2020-06-15
|
||||||
|
|
||||||
## Fixed
|
### Fixed
|
||||||
|
|
||||||
- Point to an open issue tracker
|
- Point to an open issue tracker
|
||||||
|
|
||||||
|
30
README.md
30
README.md
@ -27,6 +27,8 @@ any financial support from RedHat or Hetzner Cloud for this work.
|
|||||||
$ pip install molecule-hetznercloud
|
$ pip install molecule-hetznercloud
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you're looking for a container approach, see [ansible-community/toolset](https://github.com/ansible-community/toolset).
|
||||||
|
|
||||||
## Upgrade
|
## Upgrade
|
||||||
|
|
||||||
Please see the [CHANGELOG.md](./CHANGELOG.md) for migration guides.
|
Please see the [CHANGELOG.md](./CHANGELOG.md) for migration guides.
|
||||||
@ -87,13 +89,11 @@ $ export MOLECULE_DEBUG=True # very verbose, last ditch effort
|
|||||||
|
|
||||||
## Volume Handling
|
## Volume Handling
|
||||||
|
|
||||||
It is possible to have the driver manage volumes during the test run.
|
> **WARNING**: this feature appears to be broke. See [#24](https://github.com/ansible-community/molecule-hetznercloud/issues/24) for more
|
||||||
|
|
||||||
You can add the following stanza to your Molecule configuration to have
|
It is possible to have the driver manage volumes during the test run. You can
|
||||||
Molecule create this volume for the managed VPS. This volume will be cleaned up
|
add the following stanza to your Molecule configuration to have Molecule create
|
||||||
after use (**Please note**: there is a bug raised against clean-up right now,
|
this volume for the managed VPS. This volume will be cleaned up after use.
|
||||||
see [#24](https://github.com/ansible-community/molecule-hetznercloud/issues/24)
|
|
||||||
for more).
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
platforms:
|
platforms:
|
||||||
@ -183,7 +183,7 @@ See [CHANGELOG.md](./CHANGELOG.md).
|
|||||||
|
|
||||||
## Contact
|
## Contact
|
||||||
|
|
||||||
- Ping @decentral1se on the `#ansible-molecule` channel on [Freenode](https://webchat.freenode.net).
|
- Ping @decentral1se on the `#ansible-molecule` channel on [Libera](https://libera.chat/).
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
@ -202,12 +202,12 @@ $ tox -v
|
|||||||
|
|
||||||
### Integration
|
### Integration
|
||||||
|
|
||||||
Only doable by [Autonomic Cooperative](https://autonomic.zone/) members.
|
```
|
||||||
|
git clone https://github.com/ansible-community/molecule-hetznercloud.git
|
||||||
```bash
|
cd molecule-hetznercloud
|
||||||
$ sudo apt install -y direnv
|
python3 -m venv .venv && source .venv/bin/activate
|
||||||
$ cp .envrc.sample .envrc
|
pip install -e . "ansible<4" netaddr
|
||||||
$ direnv allow
|
export INSTANCE_UUID=$(openssl rand -hex 5)
|
||||||
$ pip install -e . ansible
|
export HCLOUD_TOKEN=YOURKEY
|
||||||
$ cd integration && molecule test
|
cd integration && molecule test
|
||||||
```
|
```
|
||||||
|
@ -7,8 +7,9 @@ platforms:
|
|||||||
- name: "molecule-hetznercloud-${INSTANCE_UUID}"
|
- name: "molecule-hetznercloud-${INSTANCE_UUID}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: debian-10
|
image: debian-10
|
||||||
volumes:
|
# https://github.com/ansible-community/molecule-hetznercloud/issues/24
|
||||||
- name: "molecule-hetznercloud-volume-1-${INSTANCE_UUID}"
|
# volumes:
|
||||||
|
# - name: "molecule-hetznercloud-volume-1-${INSTANCE_UUID}"
|
||||||
# - name: "molecule-hetznercloud-volume-2-${INSTANCE_UUID}"
|
# - name: "molecule-hetznercloud-volume-2-${INSTANCE_UUID}"
|
||||||
networks:
|
networks:
|
||||||
molecule-hetznercloud-network-1:
|
molecule-hetznercloud-network-1:
|
||||||
|
@ -67,17 +67,6 @@
|
|||||||
state: absent
|
state: absent
|
||||||
register: networks
|
register: networks
|
||||||
loop: "{{ instance_conf|subelements('networks', skip_missing=True) }}"
|
loop: "{{ instance_conf|subelements('networks', skip_missing=True) }}"
|
||||||
async: 7200
|
|
||||||
poll: 0
|
|
||||||
|
|
||||||
- name: Wait for network(s) deletion to complete
|
|
||||||
async_status:
|
|
||||||
jid: "{{ item.ansible_job_id }}"
|
|
||||||
register: hetzner_networks
|
|
||||||
until: hetzner_networks.finished
|
|
||||||
retries: 300
|
|
||||||
when: networks.changed
|
|
||||||
with_items: "{{ networks.results }}"
|
|
||||||
|
|
||||||
- name: Remove registered SSH key
|
- name: Remove registered SSH key
|
||||||
hcloud_ssh_key:
|
hcloud_ssh_key:
|
||||||
|
@ -6,16 +6,16 @@
|
|||||||
no_log: "{{ molecule_no_log }}"
|
no_log: "{{ molecule_no_log }}"
|
||||||
tasks:
|
tasks:
|
||||||
- name: Populate the instance config
|
- name: Populate the instance config
|
||||||
block:
|
|
||||||
- name: Populate instance config from file
|
|
||||||
set_fact:
|
set_fact:
|
||||||
instance_conf: "{{ lookup('file', molecule_instance_config) | from_yaml }}"
|
instance_conf: "{{ lookup('file', molecule_instance_config, errors='warn') | from_yaml }}"
|
||||||
skip_instances: false
|
skip_instances: false
|
||||||
rescue:
|
register: instance_config_lookup
|
||||||
|
|
||||||
- name: Populate instance config when file missing
|
- name: Populate instance config when file missing
|
||||||
set_fact:
|
set_fact:
|
||||||
instance_conf: {}
|
instance_conf: {}
|
||||||
skip_instances: true
|
skip_instances: true
|
||||||
|
when: not instance_config_lookup.ansible_facts.instance_conf
|
||||||
|
|
||||||
- name: Destroy molecule instance(s)
|
- name: Destroy molecule instance(s)
|
||||||
hcloud_server:
|
hcloud_server:
|
||||||
@ -63,17 +63,6 @@
|
|||||||
state: absent
|
state: absent
|
||||||
register: networks
|
register: networks
|
||||||
loop: "{{ instance_conf|subelements('networks', skip_missing=True) }}"
|
loop: "{{ instance_conf|subelements('networks', skip_missing=True) }}"
|
||||||
async: 7200
|
|
||||||
poll: 0
|
|
||||||
|
|
||||||
- name: Wait for network(s) deletion to complete
|
|
||||||
async_status:
|
|
||||||
jid: "{{ item.ansible_job_id }}"
|
|
||||||
register: hetzner_networks
|
|
||||||
until: hetzner_networks.finished
|
|
||||||
retries: 300
|
|
||||||
when: networks.changed
|
|
||||||
with_items: "{{ networks.results }}"
|
|
||||||
|
|
||||||
- name: Remove registered SSH key
|
- name: Remove registered SSH key
|
||||||
hcloud_ssh_key:
|
hcloud_ssh_key:
|
||||||
|
@ -66,17 +66,6 @@
|
|||||||
state: absent
|
state: absent
|
||||||
register: networks
|
register: networks
|
||||||
loop: "{{ instance_conf|subelements('networks', skip_missing=True) }}"
|
loop: "{{ instance_conf|subelements('networks', skip_missing=True) }}"
|
||||||
async: 7200
|
|
||||||
poll: 0
|
|
||||||
|
|
||||||
- name: Wait for network(s) deletion to complete
|
|
||||||
async_status:
|
|
||||||
jid: "{{ item.ansible_job_id }}"
|
|
||||||
register: hetzner_networks
|
|
||||||
until: hetzner_networks.finished
|
|
||||||
retries: 300
|
|
||||||
when: networks.changed
|
|
||||||
with_items: "{{ networks.results }}"
|
|
||||||
|
|
||||||
- name: Remove registered SSH key
|
- name: Remove registered SSH key
|
||||||
hcloud_ssh_key:
|
hcloud_ssh_key:
|
||||||
|
Reference in New Issue
Block a user