##### SUMMARY
The format of TXT records must consist of one or many quoted strings of
255 characters.
Use this function to format TXT record that must match the format
required by the API:
```yml
- name: Create a SPF record
hetzner.hcloud.zone_rrset:
zone: example.com
name: "@"
type: "TXT"
records:
- value: "{{ 'v=spf1 include:_spf.example.net ~all' | hetzner.hcloud.text_record }}"
state: present
```
##### ISSUE TYPE
- Feature Pull Request
##### COMPONENT NAME
zone_rrset
The CX Gen 2 and CPX Gen 1 types are deprecated and will be removed from
the API at the end of the year. This replaces all usages in our docs, so
users do not have to figure it out themselves.
Changelog Entry: https://docs.hetzner.cloud/changelog#2025-10-16-server-types-deprecated
Co-authored-by: Petteri Räty <github@petteriraty.eu>
[Server Types](https://docs.hetzner.cloud/reference/cloud#server-types)
now depend on
[Locations](https://docs.hetzner.cloud/reference/cloud#locations).
- We added a new `locations` property to the [Server
Types](https://docs.hetzner.cloud/reference/cloud#server-types)
resource. The new property defines a list of supported
[Locations](https://docs.hetzner.cloud/reference/cloud#locations) and
additional per
[Locations](https://docs.hetzner.cloud/reference/cloud#locations)
details such as deprecations information.
- We deprecated the `deprecation` property from the [Server
Types](https://docs.hetzner.cloud/reference/cloud#server-types)
resource. The property will gradually be phased out as per
[Locations](https://docs.hetzner.cloud/reference/cloud#locations)
deprecations are being announced. Please use the new per
[Locations](https://docs.hetzner.cloud/reference/cloud#locations)
deprecation information instead.
See our
[changelog](https://docs.hetzner.cloud/changelog#2025-09-24-per-location-server-types)
for more details.
**Upgrading**
```yaml
---
- name: Validate server type
hosts: localhost
connection: local
tasks:
- name: Fetch server type info
hetzner.hcloud.server_type_info:
name: cx22
register: server_type
- name: Ensure server type exists
ansible.builtin.assert:
fail_msg: server type does not exists
that:
- server_type.hcloud_server_type_info | count == 1
- name: Ensure server type is not deprecated
ansible.builtin.assert:
fail_msg: server type is deprecated
that:
- server_type.hcloud_server_type_info[0].deprecation is none
```
```yaml
---
- name: Validate server type
hosts: localhost
connection: local
tasks:
- name: Fetch location info
hetzner.hcloud.location_info:
name: fsn1
register: location
- name: Fetch server type info
hetzner.hcloud.server_type_info:
name: cx22
register: server_type
- name: Ensure server type exists
ansible.builtin.assert:
fail_msg: server type does not exists
that:
- server_type.hcloud_server_type_info | count == 1
- name: Extract server type location info
ansible.builtin.set_fact:
server_type_location: >
{{
server_type.hcloud_server_type_info[0].locations
| selectattr("name", "eq", location.hcloud_location_info[0].name)
| first
}}
- name: Ensure server type is not deprecated
ansible.builtin.assert:
fail_msg: server type is deprecated in location
that:
- server_type_location.deprecation is none
```
##### SUMMARY
The documentation states that all our returned resource ids are
integers, this change aligns our modules with the docs.
The impact of this change should be minimal, as ids are used for
identification purposes by directly forwarding the values (no
transformation of the data is done).
##### ISSUE TYPE
- Bugfix Pull Request
##### COMPONENT NAME
All modules
##### SUMMARY
<!--- Describe the change below, including rationale and design
decisions -->
Add a test that adding a placement group to a server by ID is
idempotent.
Verifies fix for #647
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
##### ISSUE TYPE
<!--- Pick one below and delete the rest -->
- Bugfix Pull Request
##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below
-->
server
##### ADDITIONAL INFORMATION
Will pass when the changes introduced in
https://github.com/hetznercloud/hcloud-python/pull/504 are available in
this module.
##### SUMMARY
- Log a warning when the provided public key does not match one in the
API.
- When the public key does not match the one in the API, allow
recreating the SSH Key in the API using the ``force=true`` argument.
Closes: #578
##### ISSUE TYPE
- Feature Pull Request
##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below
-->
`ssh_key`
##### ADDITIONAL INFORMATION
In Hetzner API, we do not have any public_key change endpoint and only
updating names and labels are allowed.
For public_key The only way is removing and re-creating. `force` option
allows users to do re-creation if needed.
---------
Co-authored-by: jo <ljonas@riseup.net>
Do not detach volume if `server` is not provided
##### SUMMARY
Volumes were automatically detached from servers if they already exists
and attached to a server.
This PR fixes this issue after adding new ```volume_attachment``` module
so user can attach/detach
volumes with that module
Fixes: #490
##### ISSUE TYPE
- Bugfix Pull Request
##### COMPONENT NAME
```volume```
---------
Co-authored-by: Jonas L. <jooola@users.noreply.github.com>
##### SUMMARY
Added `volume_attachment` as centralized module for attaching and
detaching volumes from servers.
Fixes#490
##### ISSUE TYPE
- New Module Pull Request
##### COMPONENT NAME
`volume_attachment`
---------
Co-authored-by: jo <ljonas@riseup.net>
##### SUMMARY
Fixes#600
Allow renaming a server by passing its id and its new name.
##### ISSUE TYPE
- Feature Pull Request
##### COMPONENT NAME
server
##### SUMMARY
Add a new state for server creation without immediate start, to allow
idempotent network customization before starting
##### ISSUE TYPE
- Feature Pull Request
##### COMPONENT NAME
server
---------
Co-authored-by: jo <ljonas@riseup.net>
##### SUMMARY
The previous implementation did not take into consideration label
selectors targets, and their child targets.
This change implements a recursive function that traverse all the
targets.
Related to #467#550
##### SUMMARY
Allow to compute the status of a load balancer using a filter.
Closes#467
##### ISSUE TYPE
- Feature Pull Request
##### COMPONENT NAME
hetzner.hcloud.loab_balancer_status
##### SUMMARY
Replace the constant poll interval of 1 second, with a truncated
exponential back off algorithm with jitter.
Below is a suite of poll interval (in seconds) generated by the new
algorithm:
```
1.49
2.14
5.46
6.51
6.57
5.57
5.98
7.13
6.59
7.10
5.54
5.03
6.56
5.96
6.72
7.21
7.05
5.31
5.60
6.33
6.82
5.42
6.08
6.60
TOTAL: 140.77
```
##### SUMMARY
Use shared variables to store information about which server type, image
or location to use for our integrations tests.
- The location was changed from FSN to HEL.
- The image was changed from ubuntu-22.04 to debian-12.
When the following steps are executed, the server deletion fails with a
timeout:
- delete primary IP (attached to the server)
- delete server
- timeout after 5 minutes on server delete action
Adding the 2 seconds pause will work around this timeout.
##### SUMMARY
- Do not remove the server from its placement group when the
`placement_group` argument is not specified.
- Pass an empty string to the `placement_group` argument to remove a
server from its placement group.