hetzner.hcloud.zone_rrset module – Create and manage Zone RRSets on the Hetzner Cloud.
Note
This module is part of the hetzner.hcloud collection (version 6.9.0).
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install hetzner.hcloud. You need further requirements to be able to use this module, see Requirements for details.
To use it in a playbook, specify: hetzner.hcloud.zone_rrset.
Synopsis
- Create, update and delete Zone RRSets on the Hetzner Cloud.
- See the Zone RRSets API documentation for more details.
Aliases: hcloud_zone_rrset
Requirements
The below requirements are needed on the host that executes this module.
- python-dateutil >= 2.7.5
- requests >=2.20
Parameters
Parameter | Comments |
|---|---|
api_endpoint aliases: endpoint string | The endpoint for the Hetzner Cloud API. You can also set this option by using the Default: |
api_endpoint_hetzner string | The endpoint for the Hetzner API. You can also set this option by using the Default: |
api_token string / required | The token for the Hetzner Cloud API. You can also set this option by using the |
change_protection boolean | Protect the Zone RRSet from changes (deletion and updates). Choices:
|
id integer | |
labels dictionary | User-defined key-value pairs. |
name string | Name of the Zone RRSet to manage. Only required if no Zone RRSet |
records list / elements=dictionary | Records of the Zone RRSet. |
|
comment string |
Comment of the record. |
|
value string |
Value of the record. |
state string | State of the Zone RRSet. Choices:
|
ttl integer | TTL of the Zone RRSet. |
type string | Type of the Zone RRSet to manage. Only required if no Zone RRSet |
zone string / required | Name or ID of the parent Zone. |
See Also
See also
- Documentation for Hetzner APIs
-
Complete reference for the Hetzner APIs.
Examples
- name: Create a Zone RRSet
hetzner.hcloud.zone_rrset:
zone: example.com
name: www
type: A
ttl: 300
records:
- value: 201.118.10.2
comment: web server 1
- value: 201.118.10.3
comment: web server 2
state: present
- name: Create a TXT record
hetzner.hcloud.zone_rrset:
zone: example.com
name: "@"
type: "TXT"
records:
- value: "{{ 'v=spf1 include:_spf.example.net ~all' | hetzner.hcloud.txt_record }}"
state: present
- name: Delete a Zone RRSet
hetzner.hcloud.zone_rrset:
zone: 42
name: www
type: A
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
hcloud_zone_rrset dictionary | Zone RRSet instance. Returned: always |
|
change_protection boolean |
Protect the Zone RRSet from changes (deletion and updates). Returned: always Sample: |
|
id string |
ID of the Zone RRSet. Returned: always Sample: |
|
labels dictionary |
User-defined labels (key-value pairs) Returned: always Sample: |
|
name string |
Name of the Zone RRSet. Returned: always Sample: |
|
records list / elements=dictionary |
Records of the Zone RRSet. Returned: always |
|
comment string |
Comment of the Record. Returned: always Sample: |
|
value string |
Value of the Record. Returned: always Sample: |
|
ttl integer |
TTL of the Zone RRSet. Returned: always Sample: |
|
type string |
Type of the Zone RRSet. Returned: always Sample: |
|
zone integer |
ID of the parent Zone. Returned: always Sample: |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/hetzner/hcloud/zone_rrset_module.html