Commit graph

100 commits

Author SHA1 Message Date
Jonas L
d0c82aec86
feat!: remove inventory api_token_env option (#454)
##### SUMMARY

Remove the previously deprecated `api_token_env` to fully leverage the
ansible inventory options loader.

##### ISSUE TYPE

- Feature Pull Request


##### COMPONENT NAME

inventory
2024-02-05 12:18:39 +01:00
Jonas L
86b76620da
fix: load balancer invalid cookie lifetime value returned (#452)
##### SUMMARY

The load balancer cookie lifetime field now returns the cookie lifetime
value, instead of the cookie name.

##### ISSUE TYPE

- Bugfix Pull Request

##### COMPONENT NAME

load_balancer_info
load_balancer_service
2024-02-05 09:00:26 +01:00
Jonas L
742cfe6d74
fix: allow renaming networks (#449)
##### SUMMARY

The network could not be renamed before. This was discovered while
working on #448

##### ISSUE TYPE


- Feature Pull Request


##### COMPONENT NAME

network
2024-02-02 12:53:54 +01:00
Hetzner Cloud Bot
3d689aa992
chore(main): release 2.5.0 (#419)
🤖 I have created a release *beep* *boop*
---


##
[2.5.0](https://github.com/ansible-collections/hetzner.hcloud/compare/2.4.1...2.5.0)
(2024-02-02)


### Features

* add `hostvars_prefix` and `hostvars_suffix` options to inventory
hostvars
([#423](https://github.com/ansible-collections/hetzner.hcloud/issues/423))
([4e3f89a](4e3f89aed3))
* allow forcing the deletion of firewalls that are still in use
([#447](https://github.com/ansible-collections/hetzner.hcloud/issues/447))
([559d315](559d31561a))
* improve firewall resources management
([#324](https://github.com/ansible-collections/hetzner.hcloud/issues/324))
([2757fe7](2757fe745f))
* replace `ansible.netcommon` utils with python3 `ipaddress` module
([#416](https://github.com/ansible-collections/hetzner.hcloud/issues/416))
([4cfdf50](4cfdf50b26))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
2024-02-02 10:45:50 +01:00
Jonas L
559d31561a
feat: allow forcing the deletion of firewalls that are still in use (#447)
##### SUMMARY

  - Do not silence 'firewall still in use' deletions errors.
  - Allow forcing the deletion of a firewall that is still in use.

Fixes #380

##### ISSUE TYPE

- Feature Pull Request


##### COMPONENT NAME

firewall
2024-02-02 09:48:56 +01:00
Jonas L
2757fe745f
feat: improve firewall resources management (#324)
##### SUMMARY

  - firewall - Return resources the firewall is `applied_to`.
- firewall_info - Add new `firewall_info` module to gather firewalls
info.
- firewall_resource - Add new `firewall_resource` module to manage
firewalls resources.

Fixes #111

##### ISSUE TYPE

- Feature Pull Request


##### COMPONENT NAME

firewall
firewall_info
firewall_resource

---------

Co-authored-by: Julian Tölle <julian.toelle97@gmail.com>
2024-02-01 16:50:13 +01:00
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
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
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
6581ed50db
feat: add hetzner.hcloud.all action group (#396)
##### SUMMARY

This allows to use `module_defaults` against all the modules at once
using the new `hetzner.hcloud.all` `action_group`.

You can now pass the `api_token` argument using module_defaults:

```yaml
- name: Demonstrate the usage of the 'hetzner.hcloud.all' module_defaults group
  hosts: localhost
  connection: local

  module_defaults:
    group/hetzner.hcloud.all:
      api_token: "{{ _vault_hcloud_api_token }}"

  tasks:
    - name: Create a volume
      hetzner.hcloud.volume:
        name: my-volume
        location: fsn1
        size: 100
        state: present
      register: volume
```   

See the documentation and examples for more details.

##### ISSUE TYPE

- Feature Pull Request
2023-11-23 14:16:05 +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
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
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
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
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
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
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
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
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
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
Jonas L
7d8c3f34b5
chore: prepare v2.0.0 (#276) 2023-07-24 17:10:12 +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
73b955c091
feat: drop support for python3.7 (#270) 2023-07-19 14:28:21 +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
3da91df8c3
feat: drop support for ansible-core 2.12 (#240)
* feat: drop support for ansible-core 2.12

ansible-core 2.12 is EOL since the 22 May 2023.

https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html#support-life

* dropping ansible-core versions is a breaking change

* rename changelog fragment
2023-07-05 09:11:47 +02:00
Jonas L
3055f4ab08
chore: prepare v1.15.0 (#248)
* chore: prepare v1.15.0

* bump galaxy version
2023-07-04 15:41:21 +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
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
a6fe943a9a
chore: prepare v1.14.0 (#233) 2023-06-22 14:17:50 +02:00
Jonas L
81129f373d
feat(network): add expose_routes_to_vswitch field (#232) 2023-06-22 13:09:10 +02:00
Jonas L
d33db2f51e
chore: prepare v1.13.0 (#229) 2023-06-20 15:49:06 +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
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
6a3983c9cd
chore: prepare v1.10.1 (#207) 2023-04-03 14:46:35 +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