hetzner.hcloud.hcloud_rdns module – Create and manage reverse DNS entries on the Hetzner Cloud.
Note
This module is part of the hetzner.hcloud collection (version 1.6.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
.
To use it in a playbook, specify: hetzner.hcloud.hcloud_rdns
.
Requirements
The below requirements are needed on the host that executes this module.
hcloud-python >= 1.0.0
hcloud-python >= 1.3.0
Parameters
Parameter |
Comments |
---|---|
This is the API Token for the Hetzner Cloud. |
|
The DNS address the ip_address should resolve to. Omit the param to reset the reverse DNS entry to the default value. |
|
This is the API Endpoint for the Hetzner Cloud. Default: “https://api.hetzner.cloud/v1” |
|
The name of the Hetzner Cloud Floating IP you want to add the reverse DNS entry to. |
|
The IP address that should point to dns_ptr. |
|
The name of the Hetzner Cloud Load Balancer you want to add the reverse DNS entry to. |
|
The name of the Hetzner Cloud server you want to add the reverse DNS entry to. |
|
State of the reverse DNS entry. Choices:
|
See Also
See also
- Documentation for Hetzner Cloud API
Complete reference for the Hetzner Cloud API.
Examples
- name: Create a reverse DNS entry for a server
hcloud_rdns:
server: my-server
ip_address: 123.123.123.123
dns_ptr: example.com
state: present
- name: Create a reverse DNS entry for a Floating IP
hcloud_rdns:
floating_ip: my-floating-ip
ip_address: 123.123.123.123
dns_ptr: example.com
state: present
- name: Create a reverse DNS entry for a Load Balancer
hcloud_rdns:
load_balancer: my-load-balancer
ip_address: 123.123.123.123
dns_ptr: example.com
state: present
- name: Ensure the reverse DNS entry is absent (remove if needed)
hcloud_rdns:
server: my-server
ip_address: 123.123.123.123
dns_ptr: example.com
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The reverse DNS entry Returned: always |
|
The DNS that resolves to the IP Returned: always Sample: “example.com” |
|
Name of the Floating IP Returned: always Sample: “my-floating-ip” |
|
The IP address that point to the DNS ptr Returned: always Sample: “123.123.123.123” |
|
Name of the Load Balancer Returned: always Sample: “my-load-balancer” |
|
Name of the server Returned: always Sample: “my-server” |
Authors
Lukas Kaemmerling (@lkaemmerling)