Commit graph

202 commits

Author SHA1 Message Date
Jonas L
4e3f89aed3
feat: add hostvars_prefix and hostvars_suffix options to inventory hostvars (#423)
##### SUMMARY

Add `hostvars_prefix` and `hostvars_suffix` options to customize the
inventory host variables keys.

For example, with `hostvars_prefix: hcloud_ `, the host vars will be
stored as follows:
```json
{
    "_meta": {
        "hostvars": {
            "tmp": {
                "ansible_host": "65.109.169.27",
                "hcloud_architecture": "x86",
                "hcloud_datacenter": "hel1-dc2",
                "hcloud_id": 40573407,
                "hcloud_image_id": 114690387,
                "hcloud_image_name": "debian-12",
                "hcloud_image_os_flavor": "debian",
                "hcloud_ipv4": "65.109.169.27",
                "hcloud_ipv6_network_mask": "64",
                "hcloud_ipv6_network": "2a01:4f9:c012:4377::",
                "hcloud_ipv6": "2a01:4f9:c012:4377::1",
                "hcloud_labels": {},
                "hcloud_location": "hel1",
                "hcloud_name": "tmp",
                "hcloud_private_networks": [],
                "hcloud_server_type": "cx11",
                "hcloud_status": "running",
                "hcloud_type": "cx11"
            }
        }
    }
}
``` 

Related to #116
2023-12-15 15:40:37 +01:00
Jonas L
e4501c1086
refactor: reorder inventory server type host vars (#427)
Outlines the fact that `type` and `server_type` are the same value.
2023-12-15 15:25:12 +01:00
Jonas L
4cfdf50b26
feat: replace ansible.netcommon utils with python3 ipaddress module (#416)
##### SUMMARY

Replace `ansible.netcommon` deprecated ipaddr utils with python
`ipaddress` module. The `ansible.netcommon` collection is no longer
required by the collections. We still use the `ansible.utils`
collections for testing
2023-12-12 11:50:45 +01:00
Hetzner Cloud Bot
359539fdd6
chore(main): release 2.4.1 (#405)
🤖 I have created a release *beep* *boop*
---


##
[2.4.1](https://github.com/ansible-collections/hetzner.hcloud/compare/2.4.0...2.4.1)
(2023-11-27)


### Bug Fixes

* **inventory:** always use fresh cache on new cached session
([#404](https://github.com/ansible-collections/hetzner.hcloud/issues/404))
([df7fa04](df7fa04149))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
2023-11-27 10:51:12 +01:00
Jonas L
df7fa04149
fix(inventory): always use fresh cache on new cached session (#404)
##### SUMMARY

The class scoped `cache` dict was being shared across all
`cached_session`, we now make sure that the cache is instance scoped.

Fixes #403

##### ISSUE TYPE

- Bugfix Pull Request
2023-11-24 20:50:43 +01:00
Hetzner Cloud Bot
04f63d0679
chore(main): release 2.4.0 (#392)
🤖 I have created a release *beep* *boop*
---


##
[2.4.0](https://github.com/ansible-collections/hetzner.hcloud/compare/2.3.0...2.4.0)
(2023-11-24)


### Features

* add `hetzner.hcloud.all` action group
([#396](https://github.com/ansible-collections/hetzner.hcloud/issues/396))
([6581ed5](6581ed50db))
* **inventory:** improve api options
([#397](https://github.com/ansible-collections/hetzner.hcloud/issues/397))
([9905bd0](9905bd0e01))
* remove `hcloud_` prefix from all modules names
([#390](https://github.com/ansible-collections/hetzner.hcloud/issues/390))
([933a162](933a16249b))
* rename api_endpoint module argument
([#395](https://github.com/ansible-collections/hetzner.hcloud/issues/395))
([7c9fbf8](7c9fbf85a7))


### Bug Fixes

* **inventory:** improve performance
([#402](https://github.com/ansible-collections/hetzner.hcloud/issues/402))
([f85d8f4](f85d8f4492))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
2023-11-24 14:23:24 +01:00
Jonas L
f85d8f4492
fix(inventory): improve performance (#402)
##### SUMMARY

Improve the performance of the inventory plugin by:
- Cache client requests
- Move servers `status` filtering to query params.
2023-11-24 13:43:34 +01:00
Jonas L
fb40a00689
refactor: extract client utils in reusable functions (#399)
##### SUMMARY



Extract some client utils functions in reusable function, to be used in
the inventory plugin.
2023-11-24 12:14:04 +01:00
Jonas L
df8c3b6a59
refactor: add future annotations imports (#398)
##### SUMMARY

This adds future annotations imports to benefit from the modern python
typing system.
2023-11-23 14:53:10 +01:00
Jonas L
9905bd0e01
feat(inventory): improve api options (#397)
##### SUMMARY

- Rename the inventory `token` option to `api_token`, use aliases for
backward compatibility.
- Rename the inventory `token_env` option to `api_token_env`, use
aliases for backward compatibility.
- Deprecate the inventory `api_token_env` option, suggest using a lookup
plugin (`{{ lookup('ansible.builtin.env', 'YOUR_ENV_VAR') }}`) or use
the well-known `HCLOUD_TOKEN` environment variable name.
- Let ansible parse the options, remove homemade options parsing.
- Improve and document the existing `api_endpoint` option.

##### ISSUE TYPE

- Feature Pull Request

##### COMPONENT NAME

hcloud inventory
2023-11-23 14:29:27 +01:00
Jonas L
7c9fbf85a7
feat: rename api_endpoint module argument (#395)
##### SUMMARY

Make the api endpoint module argument consistent with the api token. 
- Renamed the `endpoint` module argument to `api_endpoint`, backward
compatibility is maintained using an alias.
- Allow to configure it using the `HCLOUD_ENDPOINT` env var.

This makes the inventory config and the modules config a bit more
consistent.

##### ISSUE TYPE

- Feature Pull Request
2023-11-21 10:13:21 +01:00
Jonas L
328dfb8b0f
refactor: start using new modules names (#393)
##### SUMMARY

Update all references to modules to use the new module names.
Continuation of #390
2023-11-21 09:40:11 +01:00
Jonas L
933a16249b
feat: remove hcloud_ prefix from all modules names (#390)
##### SUMMARY

This simplifies the name of the modules from
`hetzner.hcloud.hcloud_firewall` to `hetzner.hcloud.firewall`. While
maintaining backward compatibility with the old names.

Further changes such as updating the test or the documentation will be
done in a future PR to maintain the git history when squashing the PRs.

##### ISSUE TYPE

- Feature Pull Request
2023-11-20 13:21:23 +01:00
Simon Haas
ff43534143
docs: fix typo (#391) 2023-11-20 12:39:08 +01:00
renovate[bot]
8c846f3b68
deps: update dependency hcloud to v1.32.0 (#389)
[![Mend Renovate logo
banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [hcloud](https://togithub.com/hetznercloud/hcloud-python)
([changelog](https://togithub.com/hetznercloud/hcloud-python/blob/main/CHANGELOG.md))
| `1.31.0` -> `1.32.0` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/hcloud/1.32.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/hcloud/1.32.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/hcloud/1.31.0/1.32.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/hcloud/1.31.0/1.32.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>hetznercloud/hcloud-python (hcloud)</summary>

###
[`v1.32.0`](https://togithub.com/hetznercloud/hcloud-python/blob/HEAD/CHANGELOG.md#1320-2023-11-17)

[Compare
Source](https://togithub.com/hetznercloud/hcloud-python/compare/v1.31.0...v1.32.0)

##### Features

- allow returning root_password in servers rebuild
([#&#8203;276](https://togithub.com/hetznercloud/hcloud-python/issues/276))
([38e098a](38e098a411))

##### Dependencies

- update dependency mypy to >=1.7,<1.8
([#&#8203;325](https://togithub.com/hetznercloud/hcloud-python/issues/325))
([7b59a2d](7b59a2decc))
- update pre-commit hook pre-commit/mirrors-prettier to v3.1.0
([#&#8203;326](https://togithub.com/hetznercloud/hcloud-python/issues/326))
([213b661](213b661d89))
- update pre-commit hook psf/black-pre-commit-mirror to v23.10.1
([#&#8203;322](https://togithub.com/hetznercloud/hcloud-python/issues/322))
([999afe3](999afe37e0))
- update pre-commit hook psf/black-pre-commit-mirror to v23.11.0
([#&#8203;324](https://togithub.com/hetznercloud/hcloud-python/issues/324))
([7b2a24e](7b2a24ecf6))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ansible-collections/hetzner.hcloud).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jo <ljonas@riseup.net>
2023-11-20 09:25:57 +01:00
Jonas L
2e82e0e6ef
docs: remove hcloud-python requirements from modules (#388)
##### SUMMARY

Since we vendored the hcloud-python library, those requirements are not
needed anymore.


##### ISSUE TYPE

- Docs Pull Request
2023-11-17 15:12:52 +01:00
Hetzner Cloud Bot
0e00c9f43b
chore(main): release 2.3.0 (#382)
🤖 I have created a release *beep* *boop*
---


##
[2.3.0](https://github.com/ansible-collections/hetzner.hcloud/compare/2.2.0...2.3.0)
(2023-11-07)


### Features

* add `created` field to server and server_info modules
([#381](https://github.com/ansible-collections/hetzner.hcloud/issues/381))
([c3e4c0e](c3e4c0ea0a))
* add server_types to datacenter info module
([#379](https://github.com/ansible-collections/hetzner.hcloud/issues/379))
([084e04d](084e04d576))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-11-07 12:59:43 +01:00
urbanekpj
c3e4c0ea0a
feat: add created field to server and server_info modules (#381)
##### SUMMARY
Add missing "created" field to ansible result

based on documentation
https://docs.hetzner.cloud/#servers-get-all-servers

```
created
string required
Point in time when the Resource was created (in ISO-8601 format)
```

##### ISSUE TYPE
- Feature Pull Request

##### COMPONENT NAME
hcloud_server_info
hcloud_server

Co-authored-by: Pawel Urbanek <pawel.urbanek@medvc.eu>
2023-11-06 17:10:54 +01:00
Jonas L
084e04d576
feat: add server_types to datacenter info module (#379)
##### SUMMARY

Closes #204 

Return the `server_types` dict when querying the datacenters.

##### ISSUE TYPE

- Feature Pull Request


##### COMPONENT NAME

 hcloud_datacenter_info
2023-11-06 15:23:20 +01:00
Jonas L
c491799f6f
docs: fix certificates module options and examples (#377)
##### SUMMARY

Closes #374 
Closes #375

##### ISSUE TYPE

- Docs Pull Request


##### COMPONENT NAME

hcloud_certificates
2023-10-30 17:30:49 +01:00
Hetzner Cloud Bot
0c776c3fc8
chore(main): release 2.2.0 (#360)
🤖 I have created a release *beep* *boop*
---


##
[2.2.0](https://github.com/ansible-collections/hetzner.hcloud/compare/2.1.2...2.2.0)
(2023-10-23)


### Features

* add deprecation field to hcloud_iso_info
([#357](https://github.com/ansible-collections/hetzner.hcloud/issues/357))
([76ef636](76ef636f07))
* add load_balancer algorithm option
([#368](https://github.com/ansible-collections/hetzner.hcloud/issues/368))
([a93dbaa](a93dbaa428))
* allow selecting a resource using its ID
([#361](https://github.com/ansible-collections/hetzner.hcloud/issues/361))
([5e425c5](5e425c56c2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-10-23 16:26:55 +02:00
Jonas L
41ea82cc07
refactor: don't use ISO deprecated field (#371)
##### SUMMARY

The deprecated field is deprecated, we must use the deprecation object
instead.

##### COMPONENT NAME

hcloud_iso_info
2023-10-23 13:36:14 +02:00
renovate[bot]
f35f5009aa
deps: update dependency hcloud to v1.31.0 (#370)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [hcloud](https://togithub.com/hetznercloud/hcloud-python)
([changelog](https://togithub.com/hetznercloud/hcloud-python/blob/main/CHANGELOG.md))
| `1.30.0` -> `1.31.0` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/hcloud/1.31.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/hcloud/1.31.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/hcloud/1.30.0/1.31.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/hcloud/1.30.0/1.31.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>hetznercloud/hcloud-python (hcloud)</summary>

###
[`v1.31.0`](https://togithub.com/hetznercloud/hcloud-python/blob/HEAD/CHANGELOG.md#1310-2023-10-23)

[Compare
Source](https://togithub.com/hetznercloud/hcloud-python/compare/v1.30.0...v1.31.0)

##### Features

- prepare for iso deprecated field removal
([#&#8203;320](https://togithub.com/hetznercloud/hcloud-python/issues/320))
([beae328](beae328dd6))

##### Dependencies

- update pre-commit hook psf/black-pre-commit-mirror to v23.10.0
([#&#8203;319](https://togithub.com/hetznercloud/hcloud-python/issues/319))
([184bbe6](184bbe65a7))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ansible-collections/hetzner.hcloud).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xOS4yIiwidXBkYXRlZEluVmVyIjoiMzcuMTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jo <ljonas@riseup.net>
2023-10-23 11:12:06 +02:00
Jonas L
a93dbaa428
feat: add load_balancer algorithm option (#368)
##### SUMMARY

Allow to configure load balancers algorithm.

Closes #289

Depends on #367 

##### ISSUE TYPE

- Feature Pull Request


##### COMPONENT NAME
hcloud_load_balancer
2023-10-20 12:20:09 +02:00
renovate[bot]
3058995219
deps: update pre-commit hook ansible/ansible-lint to v6.21.0 (#365)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ansible/ansible-lint](https://togithub.com/ansible/ansible-lint) |
repository | minor | `v6.20.3` -> `v6.21.0` |

Note: The `pre-commit` manager in Renovate is not supported by the
`pre-commit` maintainers or community. Please do not report any problems
there, instead [create a Discussion in the Renovate
repository](https://togithub.com/renovatebot/renovate/discussions/new)
if you have any questions.

---

### Release Notes

<details>
<summary>ansible/ansible-lint (ansible/ansible-lint)</summary>

###
[`v6.21.0`](https://togithub.com/ansible/ansible-lint/releases/tag/v6.21.0)

[Compare
Source](https://togithub.com/ansible/ansible-lint/compare/v6.20.3...v6.21.0)

#### Minor Changes

- Allow linting plugin EXAMPLES as playbooks
([#&#8203;3309](https://togithub.com/ansible/ansible-lint/issues/3309))
[@&#8203;Qalthos](https://togithub.com/Qalthos)

#### Bugfixes

- Add support for Rocky
([#&#8203;3843](https://togithub.com/ansible/ansible-lint/issues/3843))
[@&#8203;facorazza](https://togithub.com/facorazza)
- Update supported Ubuntu versions in `meta.json`
([#&#8203;3845](https://togithub.com/ansible/ansible-lint/issues/3845))
[@&#8203;mcdonnnj](https://togithub.com/mcdonnnj)
- Avoid false positives for handler in roles handlers directory
([#&#8203;3838](https://togithub.com/ansible/ansible-lint/issues/3838))
[@&#8203;ajinkyau](https://togithub.com/ajinkyau)
- Hide stacktrace when loading invalid yaml
([#&#8203;3844](https://togithub.com/ansible/ansible-lint/issues/3844))
[@&#8203;ajinkyau](https://togithub.com/ajinkyau)
- Add some platforms to `meta.json`
([#&#8203;3841](https://togithub.com/ansible/ansible-lint/issues/3841))
[@&#8203;mcdonnnj](https://togithub.com/mcdonnnj)
- Temporary avoid auto-fixing YAML files not owned by ansible
([#&#8203;3837](https://togithub.com/ansible/ansible-lint/issues/3837))
[@&#8203;ssbarnea](https://togithub.com/ssbarnea)
- Add environment variable for skipping schema update
([#&#8203;3835](https://togithub.com/ansible/ansible-lint/issues/3835))
[@&#8203;ajinkyau](https://togithub.com/ajinkyau)
- Avoid creating temporary YAML files inside source tree
([#&#8203;3819](https://togithub.com/ansible/ansible-lint/issues/3819))
[@&#8203;Qalthos](https://togithub.com/Qalthos)
- Document environment variables
([#&#8203;3833](https://togithub.com/ansible/ansible-lint/issues/3833))
[@&#8203;ssbarnea](https://togithub.com/ssbarnea)
- Update schemas
([#&#8203;3832](https://togithub.com/ansible/ansible-lint/issues/3832))
[@&#8203;ssbarnea](https://togithub.com/ssbarnea)
- Support complex requirements in argument_specs.yml
([#&#8203;3823](https://togithub.com/ansible/ansible-lint/issues/3823))
[@&#8203;tapetersen](https://togithub.com/tapetersen)
- Fix SARIF-formatter severity levels
([#&#8203;3824](https://togithub.com/ansible/ansible-lint/issues/3824))
[@&#8203;4ch1m](https://togithub.com/4ch1m)
- Add play level autofix for key-order rule
([#&#8203;3815](https://togithub.com/ansible/ansible-lint/issues/3815))
[@&#8203;ajinkyau](https://togithub.com/ajinkyau)
- Add support for python 3.12
([#&#8203;3813](https://togithub.com/ansible/ansible-lint/issues/3813))
[@&#8203;ssbarnea](https://togithub.com/ssbarnea)
- Update SPDX license list
([#&#8203;3814](https://togithub.com/ansible/ansible-lint/issues/3814))
[@&#8203;ssbarnea](https://togithub.com/ssbarnea)
- Use checkout action in install docs
([#&#8203;3810](https://togithub.com/ansible/ansible-lint/issues/3810))
[@&#8203;gma](https://togithub.com/gma)
- Fix actions-tagger arguments
([#&#8203;3808](https://togithub.com/ansible/ansible-lint/issues/3808))
[@&#8203;ssbarnea](https://togithub.com/ssbarnea)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ansible-collections/hetzner.hcloud).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xOS4yIiwidXBkYXRlZEluVmVyIjoiMzcuMTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jo <ljonas@riseup.net>
2023-10-19 12:41:44 +02:00
Jonas L
5e425c56c2
feat: allow selecting a resource using its ID (#361)
##### SUMMARY

Allow referring to resources using their IDs for:
- hcloud_load_balancer_network
- hcloud_load_balancer_service
- hcloud_load_balancer_target
- hcloud_rdns
- hcloud_route
- hcloud_server_network
- hcloud_subnetwork


##### ISSUE TYPE

- Feature Pull Request


##### COMPONENT NAME
- hcloud_load_balancer_network
- hcloud_load_balancer_service
- hcloud_load_balancer_target
- hcloud_rdns
- hcloud_route
- hcloud_server_network
- hcloud_subnetwork
2023-10-18 10:28:42 +02:00
Jonas L
76ef636f07
feat: add deprecation field to hcloud_iso_info (#357)
##### SUMMARY

See these changelog entries for the announcement:

-
https://docs.hetzner.cloud/changelog#2023-10-12-deprecation-info-for-isos
-
https://docs.hetzner.cloud/changelog#2023-10-12-field-deprecated-on-isos-is-now-deprecated


##### ISSUE TYPE

- Feature Pull Request


##### COMPONENT NAME
hcloud_iso_info
2023-10-16 11:16:31 +02:00
renovate[bot]
11ffbd9d43
deps: update dependency hcloud to v1.30.0 (#358)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [hcloud](https://togithub.com/hetznercloud/hcloud-python)
([changelog](https://togithub.com/hetznercloud/hcloud-python/blob/main/CHANGELOG.md))
| `1.29.1` -> `1.30.0` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/hcloud/1.30.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/hcloud/1.30.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/hcloud/1.29.1/1.30.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/hcloud/1.29.1/1.30.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>hetznercloud/hcloud-python (hcloud)</summary>

###
[`v1.30.0`](https://togithub.com/hetznercloud/hcloud-python/blob/HEAD/CHANGELOG.md#1300-2023-10-13)

[Compare
Source](https://togithub.com/hetznercloud/hcloud-python/compare/v1.29.1...v1.30.0)

##### Features

- add deprecation field to Iso
([#&#8203;318](https://togithub.com/hetznercloud/hcloud-python/issues/318))
([036b52f](036b52fe51))
- support python 3.12
([#&#8203;311](https://togithub.com/hetznercloud/hcloud-python/issues/311))
([7e8cd1d](7e8cd1d92e))

##### Dependencies

- update dependency mypy to >=1.6,<1.7
([#&#8203;317](https://togithub.com/hetznercloud/hcloud-python/issues/317))
([d248bbd](d248bbd4e5))
- update dependency pylint to v3
([#&#8203;307](https://togithub.com/hetznercloud/hcloud-python/issues/307))
([277841d](277841dd84))
- update pre-commit hook asottile/pyupgrade to v3.14.0
([#&#8203;308](https://togithub.com/hetznercloud/hcloud-python/issues/308))
([07a4513](07a4513e28))
- update pre-commit hook asottile/pyupgrade to v3.15.0
([#&#8203;312](https://togithub.com/hetznercloud/hcloud-python/issues/312))
([c544639](c5446394ac))
- update pre-commit hook pre-commit/pre-commit-hooks to v4.5.0
([#&#8203;313](https://togithub.com/hetznercloud/hcloud-python/issues/313))
([e51eaa9](e51eaa9903))
- update python docker tag to v3.12
([#&#8203;309](https://togithub.com/hetznercloud/hcloud-python/issues/309))
([3a1ee67](3a1ee675f2))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ansible-collections/hetzner.hcloud).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44LjEiLCJ1cGRhdGVkSW5WZXIiOiIzNy44LjEiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jo <ljonas@riseup.net>
2023-10-13 16:26:39 +02:00
Hetzner Cloud Bot
e692b3e2e0
chore(main): release 2.1.2 (#335)
🤖 I have created a release *beep* *boop*
---


##
[2.1.2](https://github.com/ansible-collections/hetzner.hcloud/compare/2.1.1...v2.1.2)
(2023-10-05)


### Bug Fixes

* firewall port argument is required with udp or tcp
([#345](https://github.com/ansible-collections/hetzner.hcloud/issues/345))
([76c1abf](76c1abf447))
* invalid field in load_balancer_service health_check.http return data
([#333](https://github.com/ansible-collections/hetzner.hcloud/issues/333))
([fb35516](fb35516e76))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
2023-10-05 16:40:02 +02:00
Jonas L
76c1abf447
fix: firewall port argument is required with udp or tcp (#345)
##### SUMMARY

When managing a tcp/udp firewall rule, provide a clear error message
when the port is missing from the rule.

Closes #344

##### ISSUE TYPE

- Bugfix Pull Request


##### COMPONENT NAME

hcloud_firewall
2023-10-04 10:59:50 +02:00
renovate[bot]
3dffaafcdc
deps: update dependency hcloud to v1.29.1 (#339)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [hcloud](https://togithub.com/hetznercloud/hcloud-python)
([changelog](https://togithub.com/hetznercloud/hcloud-python/blob/main/CHANGELOG.md))
| `1.29.0` -> `1.29.1` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/hcloud/1.29.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/hcloud/1.29.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/hcloud/1.29.0/1.29.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/hcloud/1.29.0/1.29.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>hetznercloud/hcloud-python (hcloud)</summary>

###
[`v1.29.1`](https://togithub.com/hetznercloud/hcloud-python/blob/HEAD/CHANGELOG.md#1291-2023-09-26)

[Compare
Source](https://togithub.com/hetznercloud/hcloud-python/compare/v1.29.0...v1.29.1)

##### Bug Fixes

- prevent api calls when printing bound models
([#&#8203;305](https://togithub.com/hetznercloud/hcloud-python/issues/305))
([c1de7ef](c1de7efc85))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ansible-collections/hetzner.hcloud).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDcuMiIsInVwZGF0ZWRJblZlciI6IjM2LjEwNy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jo <ljonas@riseup.net>
2023-09-26 19:55:44 +02:00
Jonas L
94190ae6cb
refactor: move module vars out of __init__ (#336)
##### SUMMARY

- move module vars out of `__init__`
- add modules type hints
- catch hcloud exception for api calls
2023-09-26 09:41:01 +02:00
renovate[bot]
4ae557c287
deps: update dependency hcloud to v1.29.0 (#334)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [hcloud](https://togithub.com/hetznercloud/hcloud-python)
([changelog](https://togithub.com/hetznercloud/hcloud-python/blob/main/CHANGELOG.md))
| `1.28.0` -> `1.29.0` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/hcloud/1.29.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/hcloud/1.29.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/hcloud/1.28.0/1.29.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/hcloud/1.28.0/1.29.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>hetznercloud/hcloud-python (hcloud)</summary>

###
[`v1.29.0`](https://togithub.com/hetznercloud/hcloud-python/blob/HEAD/CHANGELOG.md#1290-2023-09-25)

[Compare
Source](https://togithub.com/hetznercloud/hcloud-python/compare/v1.28.0...v1.29.0)

##### Features

- add domain attribute type hints to bound models
([#&#8203;300](https://togithub.com/hetznercloud/hcloud-python/issues/300))
([6d46d06](6d46d06c42))
- **firewalls:** add `applied_to_resources` to `FirewallResource`
([#&#8203;297](https://togithub.com/hetznercloud/hcloud-python/issues/297))
([55d2b20](55d2b2043e))

##### Bug Fixes

- missing BaseDomain base class inheritance
([#&#8203;303](https://togithub.com/hetznercloud/hcloud-python/issues/303))
([0ee7598](0ee759856c))

##### Dependencies

- update actions/checkout action to v4
([#&#8203;295](https://togithub.com/hetznercloud/hcloud-python/issues/295))
([c02b446](c02b4468f0))
- update dependency sphinx to >=7.2.2,<7.3
([#&#8203;291](https://togithub.com/hetznercloud/hcloud-python/issues/291))
([10234ea](10234ea7bf))
- update dependency sphinx to v7
([#&#8203;211](https://togithub.com/hetznercloud/hcloud-python/issues/211))
([f635c94](f635c94c23))
- update pre-commit hook asottile/pyupgrade to v3.11.0
([#&#8203;298](https://togithub.com/hetznercloud/hcloud-python/issues/298))
([4bbd0cc](4bbd0ccb0f))
- update pre-commit hook asottile/pyupgrade to v3.11.1
([#&#8203;299](https://togithub.com/hetznercloud/hcloud-python/issues/299))
([2f9fcd7](2f9fcd7bb8))
- update pre-commit hook asottile/pyupgrade to v3.13.0
([#&#8203;301](https://togithub.com/hetznercloud/hcloud-python/issues/301))
([951dbf3](951dbf3e3b))
- update pre-commit hook pre-commit/mirrors-prettier to v3.0.3
([#&#8203;294](https://togithub.com/hetznercloud/hcloud-python/issues/294))
([381e336](381e336ff1))
- update pre-commit hook psf/black to v23.9.1
([#&#8203;296](https://togithub.com/hetznercloud/hcloud-python/issues/296))
([4374a7b](4374a7be9f))

##### Documentation

- load token from env in examples scripts
([#&#8203;302](https://togithub.com/hetznercloud/hcloud-python/issues/302))
([f18c9a6](f18c9a60e0))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ansible-collections/hetzner.hcloud).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi45Ny4xIiwidXBkYXRlZEluVmVyIjoiMzYuOTcuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jo <ljonas@riseup.net>
2023-09-25 13:34:49 +02:00
Jonas L
fb35516e76
fix: invalid field in load_balancer_service health_check.http return data (#333)
##### SUMMARY

In the `hcloud_load_balancer_service` return data, the
`health_check.http.certificates` field must be named
`health_check.http.status_codes`.

https://docs.hetzner.cloud/#load-balancers-get-a-load-balancer

Fixes #332 

##### ISSUE TYPE

- Bugfix Pull Request


##### COMPONENT NAME

hcloud_load_balancer_service
2023-09-25 12:20:18 +02:00
Jonas L
e6328d770b
refactor: add plugins top level __init__ (#320)
##### SUMMARY

This make python/pylint happy when using relative imports between
`modules` and `module_utils`.
2023-09-06 16:06:25 +02:00
Julian Tölle
eb4114bad3
ci: setup release-please (#317)
##### SUMMARY

The current release process for this project requires multiple manual
local steps to prepare and then tag the release. This introduces the
standard release-please workflow we have in most of our integrations.

Release-please will open a new PR whenever there is a releasable change
and it updates the CHANGELOG & other files automatically in this PR.
Once the PR is merged a new tag is created.

This repository has some additional complexity as it uses
`antsibull-changelog` to maintain the user-facing changelog. This is
implemented ina second job in the `release-please` workflow which
executes when the release-please PR is updated and then runs
`antsibull-changelog release` against the version. The resulting changes
are pushed as a second commit to the same PR.
2023-09-05 14:49:05 +02:00
Jonas L
aeda12275c
chore: add antsibull-docs lint-collection pre-commit hook (#315)
##### SUMMARY

This check will run a linter against the documentation. I was already
able to fix a few errors.
2023-08-31 15:20:14 +02:00
Jonas L
6844317920
refactor: fix pylint invalid variable name (#312)
##### SUMMARY

Pylint complains about too short/meaningless variable names. We want to
be explicit when naming variables.
2023-08-25 16:19:15 +02:00
Jonas L
c56cbab1a0
refactor: use f-strings (#310)
##### SUMMARY

Replace string interpolation with f-strings. Improves readability, and
should help prevent #309
2023-08-24 11:27:40 +02:00
Jonas L
deee06281e
chore: prepare v2.1.1 (#311)
##### SUMMARY

Prepare v2.1.1 release.

This should also trigger a new publish process, since 2.1.0 never had
the change to be published to ansible-galaxy.
2023-08-23 15:44:10 +02:00
urbanekpj
8f42c4d950
fix: string formatting error on deprecated server type warning (#309)
##### SUMMARY
after deprecating "server type" warning should be shown but due to error
in string message there is crash.
```
 File "/tmp/ansible_hcloud_server_payload__bgoim7j/ansible_hcloud_server_payload.zip/ansible_collections/hetzner/hcloud/plugins/modules/hcloud_server.py", line 942, in <module>
  File "/tmp/ansible_hcloud_server_payload__bgoim7j/ansible_hcloud_server_payload.zip/ansible_collections/hetzner/hcloud/plugins/modules/hcloud_server.py", line 925, in main
  File "/tmp/ansible_hcloud_server_payload__bgoim7j/ansible_hcloud_server_payload.zip/ansible_collections/hetzner/hcloud/plugins/modules/hcloud_server.py", line 858, in present_server
  File "/tmp/ansible_hcloud_server_payload__bgoim7j/ansible_hcloud_server_payload.zip/ansible_collections/hetzner/hcloud/plugins/modules/hcloud_server.py", line 405, in _create_server
  File "/tmp/ansible_hcloud_server_payload__bgoim7j/ansible_hcloud_server_payload.zip/ansible_collections/hetzner/hcloud/plugins/modules/hcloud_server.py", line 541, in _get_server_type
  File "/tmp/ansible_hcloud_server_payload__bgoim7j/ansible_hcloud_server_payload.zip/ansible_collections/hetzner/hcloud/plugins/modules/hcloud_server.py", line 558, in _check_and_warn_deprecated_server
TypeError: %i format: a real number is required, not str
```

##### ISSUE TYPE
- Bugfix Pull Request

##### COMPONENT NAME
hcloud_server

---------

Co-authored-by: jo <ljonas@riseup.net>
2023-08-23 14:08:06 +02:00
Jonas L
372023796a
chore: prepare v2.1.0 (#304)
##### SUMMARY

 Prepare v2.1.0 release.
2023-08-21 09:35:36 +02:00
Jonas L
5475a9929a
feat: target health status in hcloud_load_balancer_info (#305) 2023-08-17 15:25:14 +02:00
renovate[bot]
7d2300f1ec
deps: update dependency hcloud to v1.28.0 (#306)
* deps: update dependency hcloud to v1.28.0

* chore: update vendored files

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jo <ljonas@riseup.net>
2023-08-17 15:02:50 +02:00
Jonas L
4bb2bb80fa
feat: query floating ip info by name (#303)
##### SUMMARY

Fixes #302 

The feature was missing, this make the floating_ip_info module consistent with what is expected to be implemented. 

##### ISSUE TYPE

- Feature Pull Request


##### COMPONENT NAME

floating_ip_info
2023-08-17 11:50:19 +02:00
Jonas L
e461a890fa
fix: consistently fail on invalid ID in *_info modules (#301)
* fix: consistently fail on invalid ID in `*_info` modules

* remove unused import
2023-08-16 16:14:55 +02:00
Jonas L
32b44647ef
feat: allow caching the hcloud inventory (#287)
* feat: allow caching the hcloud inventory

* chore: add changelog fragment
2023-08-16 11:59:17 +02:00
Jonas L
2d739edc88
feat: use collection version for the inventory user agent (#297) 2023-08-14 15:55:04 +02:00
renovate[bot]
e89835531f
deps: update dependency hcloud to v1.27.2 (#294)
* deps: update dependency hcloud to v1.27.2

* chore: update vendored files

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jo <ljonas@riseup.net>
2023-08-11 16:09:41 +02:00
Jonas L
5c4079e059
fix: do not error on location_info invalid id (#292)
* test: fix hcloud_location_info with wrong id test

* chore: cleanup hcloud_location_info tests

* fix: error on location_info invalid id
2023-08-09 12:42:22 +02:00
Jonas L
dd5ee78386
feat: replace ansible version with collection version in hcloud user agent (#291)
* feat: use collection version in hcloud user-agent

* chore: add version sync pre-commit hook

* chore: add changelog fragment
2023-08-09 11:34:12 +02:00
renovate[bot]
ff539800aa
deps: update dependency hcloud to v1.27.1 (#290)
* deps: update dependency hcloud to v1.27.1

* chore: update vendored files

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jo <ljonas@riseup.net>
2023-08-08 18:17:22 +02:00
Jonas L
a0e91d942a
refactor: rename ansible module classes (#284)
* refactor: rename Hcloud class to AnsibleHCloud

* refactor: rename AnsibleHCloud* modules

* refactor: remove Hcloud deprecation wrapper
2023-08-04 09:24:14 +02:00
Jonas L
98afa99904
refactor: use super() to reference parent class (#280) 2023-08-02 12:05:00 +02:00
Jonas L
64b6804b41
refactor: use relative imports for local modules (#279) 2023-07-31 10:12:55 +02:00
Jonas L
652a41df9d
fix!: don't set inventory image vars if server image is undefined (#275)
Related to #116

Don't set "No Image * found" string if the server image is not defined. This is not an intuitive behavior.

This is a breaking change.
2023-07-24 14:44:52 +02:00
Jonas L
c15377c672
feat: improve hcloud library exceptions handling (#243) 2023-07-20 14:34:48 +02:00
Jonas L
51f705c343
chore: use fqcn module names (#273) 2023-07-20 12:14:57 +02:00
renovate[bot]
f197607dad
deps: update dependency hcloud to v1.26.0 (#268)
* deps: update dependency hcloud to v1.26.0

* feat: upgrade vendored files

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jo <ljonas@riseup.net>
2023-07-19 15:31:18 +02:00
Jonas L
8a6157e8b2
feat: vendor hcloud python dependency (#244)
* chore: ignore venv directories

* chore: ignore integration test generated inventory

* feat: vendor hcloud package

* import https://github.com/hetznercloud/hcloud-python

* use vendored hcloud in modules

* update integration test requirements

* make vendor script self contained

* chore: add  check-hcloud-vendor pre-commit hook

* pin hcloud version to v.1.24.0

* move vendored __version__.py file to _version.py

* update comment about galaxy-importer filename lint
2023-07-11 11:15:08 +02:00
Jonas L
5190535323
feat: remove deprecated facts modules (#251)
Fixes #8
2023-07-05 09:32:03 +02:00
Jonas L
ef802e7351
docs(hcloud_server_network): fix modules params (#250)
Cherry picked from the https://github.com/ansible-collections/hetzner.hcloud/pull/9
2023-07-04 13:48:04 +02:00
Jonas L
98022020a1
feat: add hcloud_iso_info module (#237)
* Added new command hcloud_isos_info.py to get informations from all ISOs on HETZNER cloud.

* continue iso_info implementation

* add changelog

* fixes and improvements

* remove return docs choices for ansible 2.12 support

* rebase changes

* fix wording

Co-authored-by: Julian Tölle <julian.toelle97@gmail.com>

* run tests in group3

Co-authored-by: Julian Tölle <julian.toelle97@gmail.com>

* docs: returned architecture field might be null

* unused/invalid community.general.ipfilter collection in tests

* update wording relevant -> supported

* apply rebase changes

---------

Co-authored-by: patlegu <3754859+patlegu@users.noreply.github.com>
Co-authored-by: Julian Tölle <julian.toelle97@gmail.com>
2023-07-04 09:54:53 +02:00
Jonas L
0fcf4aad22
refactor: use new to_native function path (#238)
e535eb625b/lib/ansible/module_utils/_text.py
2023-06-27 13:17:21 +02:00
Jonas L
10f47eab0f
fix: facts deprecation warnings and result (#236)
The facts deprecation warnings or result dicts had some small nits.
2023-06-27 12:20:14 +02:00
Jonas L
dfff49e31f
chore: setup pre-commit (#234)
* chore: add pre-commit config

* chore: fix pre-commit errors

* chore: add black pre-commit hook

* style: format python files with black

* chore: add isort pre-commit hook

* style: format python files using isort

* chore: add pyupgrade pre-commit hook

* refactor: upgrade code to python3.7

* Allow stacking PRs

Co-authored-by: Julian Tölle <julian.toelle97@gmail.com>

---------

Co-authored-by: Julian Tölle <julian.toelle97@gmail.com>
2023-06-27 11:50:13 +02:00
Jonas L
e83997517d
test: support python >=3.7 for ansible-test (#235)
* test: only test for python >=3.7

* refactor: remove python 2 utc timezone workaround
2023-06-23 14:43:42 +02:00
Jonas L
81129f373d
feat(network): add expose_routes_to_vswitch field (#232) 2023-06-22 13:09:10 +02:00
Jonas L
02516d9a7b
refactor: prefer true/false over yes/no (#226)
* style: format md and yml files using prettier

* refactor: prefer true/false over yes/no
2023-06-21 10:49:54 +02:00
Jonas L
27821140d7
feat(primary_ip): add hcloud_primary_ip_info module (#225)
Co-authored-by: Kevin Castner <kcastner@kcastner.de>
2023-06-20 14:01:55 +02:00
Julian Tölle
23c2d7d228
ci: ubuntu-18.04 is deprecated/EOL (#224)
Update all references to ubuntu-18.04 (and 20.04) to 22.04, as ubuntu
18.04 is EOL and deprecated in Hetzner Cloud. This causes a CI failure
in the main branch:

https://dev.azure.com/ansible/hetzner.hcloud/_build/results?buildId=80941&view=logs&j=fdb818b8-39d8-529a-d9da-324e304604bc&t=2d52cce2-88ce-5057-da88-145e92cee00f&l=1094
2023-06-20 11:38:51 +02:00
Julian Tölle
082153a700
feat: Server Type Deprecation (#222)
* feat(server_type_info): return deprecation info

Co-authored-by: jo <ljonas@riseup.net>

* feat(server): show warning if server-type is deprecated

Co-authored-by: jo <ljonas@riseup.net>

---------

Co-authored-by: jo <ljonas@riseup.net>
2023-06-20 11:38:38 +02:00
Julian Tölle
9b471cbb00
fix(server): TypeError when using deprecated image (#219)
When using a deprecated image with the "allow_deprecated_image" flag,
the script would crash because the string interpolation was not done
correctly. The brackes were in the wrong place.

Error would look like this:

   An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: unsupported operand type(s) for %: 'NoneType' and 'str'
   fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/home/julian/.ansible/tmp/ansible-tmp-1686564668.6136558-165294-192879183382787/AnsiballZ_hcloud_server.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/julian/.ansible/tmp/ansible-tmp-1686564668.6136558-165294-192879183382787/AnsiballZ_hcloud_server.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/julian/.ansible/tmp/ansible-tmp-1686564668.6136558-165294-192879183382787/AnsiballZ_hcloud_server.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.hetzner.hcloud.plugins.modules.hcloud_server', init_globals=dict(_module_fqn='ansible_collections.hetzner.hcloud.plugins.modules.hcloud_server', _modlib_path=modlib_path),\n  File \"/nix/store/95cxzy2hpizr23343b8bskl4yacf4b3l-python3-3.10.11/lib/python3.10/runpy.py\", line 224, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/nix/store/95cxzy2hpizr23343b8bskl4yacf4b3l-python3-3.10.11/lib/python3.10/runpy.py\", line 96, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/nix/store/95cxzy2hpizr23343b8bskl4yacf4b3l-python3-3.10.11/lib/python3.10/runpy.py\", line 86, in _run_code\n    exec(code, run_globals)\n  File \"/run/user/1000/ansible_hcloud_server_payload_1g2rf66q/ansible_hcloud_server_payload.zip/ansible_collections/hetzner/hcloud/plugins/modules/hcloud_server.py\", line 927, in <module>\n  File \"/run/user/1000/ansible_hcloud_server_payload_1g2rf66q/ansible_hcloud_server_payload.zip/ansible_collections/hetzner/hcloud/plugins/modules/hcloud_server.py\", line 908, in main\n  File \"/run/user/1000/ansible_hcloud_server_payload_1g2rf66q/ansible_hcloud_server_payload.zip/ansible_collections/hetzner/hcloud/plugins/modules/hcloud_server.py\", line 843, in present_server\n  File \"/run/user/1000/ansible_hcloud_server_payload_1g2rf66q/ansible_hcloud_server_payload.zip/ansible_collections/hetzner/hcloud/plugins/modules/hcloud_server.py\", line 411, in _create_server\n  File \"/run/user/1000/ansible_hcloud_server_payload_1g2rf66q/ansible_hcloud_server_payload.zip/ansible_collections/hetzner/hcloud/plugins/modules/hcloud_server.py\", line 518, in _get_image\nTypeError: unsupported operand type(s) for %: 'NoneType' and 'str'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
2023-06-19 15:17:07 +02:00
Julian Tölle
94a7a59a84
docs: show warning if image_info is used without architecture (#215) 2023-05-16 11:29:53 +02:00
Julian Tölle
90451c22e3
fix(server): only show force_upgrade warning if actually set (#214)
Make sure that we only log the deprecation warning if force_upgrade was actually
set. Right now it also logs because a default value for the field is set.
2023-05-16 11:29:41 +02:00
Julian Tölle
1cf7be0486
feat(server_type): return included traffic (#212) 2023-05-15 09:40:19 +02:00
Julian Tölle
3c2d4df8bb
feat: add support for ARM APIs (#208)
* feat: add architecture fields for image & server type

* feat: filter images by architecture

* feat: select right image by arch on server create & rebuild

* feat(inventory): add architecture field to returned servers

* docs: add changelog for arm features

* chore: prepare v1.11.0
2023-04-12 10:43:19 +02:00
lrsksr
25bce7eabd
fix(server): prevent backups from being disabled when undefined (#196)
* fix(server): prevent backups from being disabled when undefined

With an existing server with backups enabled and the state being either
present, started, stopped, restarted or rebuild and the backups module
parameter not set, the module would disable backups and in turn delete
all existing backups.

The correct behaviour (leave backups untouched when parameter not set)
is implemented by this commit. Strong typing would have prevented this.

* test: verify fix works

---------

Co-authored-by: Julian Tölle <julian.toelle@hetzner-cloud.de>
2023-04-03 12:36:33 +02:00
Julian Tölle
43ae035040
lint: fix unused-import errors (#195)
The linting rule `unused-import` was recently activated in ansible-test.

This commit removes all unused imports to satify the linting rule.
2023-03-31 09:01:22 +02:00
Julian Tölle
60d9cf74a6
fix(server): server still locked after placement_group attach (#192)
In some cases the server was still marked as locked after attaching it to
a placement_group. This caused potential follow up tasks that use the server
to fail.

This happened because the action returned by `add_to_placement_group()` was
not waited upon.

For the detach case this is handled correctly.
2023-02-08 10:07:46 +01:00
Julian Tölle
1863fe512c
feat(inventory): add variable for ipv6 address (#188)
This variable matches the `ansible_host` variable that we set when
`connect_with: public_ipv6`, and allows the user to dynamically choose the
connection method in `compose`.
2023-02-01 12:56:21 +01:00
Julian Tölle
bfe0f7a575
feat(inventory): handle servers that dont work with connect_with setting (#187)
Currently if any of the servers in the inventory do not work with the
selected `connect_with` mode, the script exits and returns 0 servers.
This can happen for example if one of your servers does not have a public
ipv4 address, but you set `connect_with: public_ipv4` (default).

This commit changes the behaviour to log a warning message, and just skip
setting `ansible_host` for this server. This server will not be reachable
by ansible by default, but users can use `compose` to override the
`ansible_host` that we set based on the other variables.
2023-02-01 10:41:36 +01:00
Julian Tölle
83094a121d
feat(inventory): add all private networks as variables (#186)
This can be used in the `compose`, `groups` and `keyed_groups` settings
to dynamically build the inventory.

It also makes it possible for the user to override the `ansible_host`
in `compose`, based on wether or not the server has a public ipv4 address,
with fallback to the address in a specific private network.
2023-01-31 17:09:54 +01:00
Sander van Rossem
9bc9949869
Increase rebuild wait_until_finished() timeout (#189) 2023-01-31 16:48:02 +01:00
n00b42
129d3e8ddc
feat: add private_networks_info containing name and private ip in server responses (#183)
Co-authored-by: Maximilian Senftleben <maximilian.senftleben@frogblue-tec.com>
2023-01-31 12:29:27 +01:00
n00b42
ccfa51bf66
feat: Pass extra vars to templating of api_token. (#156)
Co-authored-by: Maximilian Senftleben <maximilian.senftleben@frogblue-tec.com>
2023-01-30 12:08:09 +01:00
Julian Tölle
b5f205485a
feat(inventory): connect via public ipv6 address (#176)
Add a new `connect_with` option `public_ipv6` that uses the first
address from the servers publically-routed ipv6 network.
2022-12-21 11:10:58 +01:00
Julian Tölle
2589783e19
fix(server): attached networks are removed when not defined in hcloud_server (#175)
Fixes #174
2022-12-20 14:49:48 +01:00
Konstantin Köhring
ad8958a2ad
Add possibility to specify private network when creating or updating servers (#160)
* Add possibility to specify private network when creating or updating a server

This allows creating servers without public internet access

* Add integration tests
2022-11-09 22:31:03 +01:00
Lukas Kämmerling
6de022e9fb
hcloud_firewall: Fix race condition on deletion of firewalls (#166)
Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>

Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>
2022-11-08 14:05:13 +01:00
Lukas Kämmerling
123ad2c1b0
hcloud_volume & hcloud_volume_info: "None" -> null (#165)
Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>

Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>
2022-11-08 10:14:24 +01:00
Lukas Kämmerling
d1c97c7e89
Inventory Plugin: Add support for changing the name of the top level group all servers are added to (#164)
Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>

Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>
2022-11-08 09:01:14 +01:00
Lukas Kämmerling
2623b75b10
Docs: Document possibility to set the module api_token via environment variable (#163)
Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>

Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>
2022-11-08 08:41:17 +01:00
Lukas Kämmerling
78f0a0a519
hcloud_server & hcloud_server_info fix backup window given out as "None" (#162)
Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>

Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>
2022-11-07 14:49:19 +01:00
Konstantin Köhring
5cc7c58ecf
fix hcloud_network_info failing without internet connectivity (#159)
This fixes the behavior if there is a server without direct internet
connectivity in the examined network.
Previously, the module would throw an AttributeError because
server.public_net.ipv4/ipv6 is None in this case. Now the None propagates
correctly.
2022-11-07 13:59:21 +01:00
Lukas Kämmerling
a87c82d808
hcloud_firewall: Add support for esp and gre (#161)
Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>

Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>
2022-11-07 13:58:43 +01:00
Lukas Kämmerling
6a7088cf42
- hcloud_server_info - fix crash when having servers without IPs (flexible networks) (#143)
- hcloud_server - When state stopped and server is created, do not start the server

Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>
2022-07-13 08:54:55 +02:00
Lukas Kämmerling
0965f79093
Add support for Primary IPs (#141)
Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>
2022-06-29 09:58:01 +02:00
René Moser
1d568f3ac7
loadbalancer_: improve error handlings (#138)
* loadbalancer_: improve error handlings

* streamline a bit to make ansible 2.9 pass

* handle race condition
2022-06-20 06:26:26 +02:00
René Moser
a0a5da3f46
hcloud_load_balancer_target: fix types in examples (#136) 2022-06-17 22:15:35 +02:00