This project includes two small modules to create reverse DNS records for Hetzner virtual servers.
Clone this repository and copy the modules from library/
to
your Ansible project's library
directory.
This module creates reverse DNS records through the Hetzner Cloud API1.
- name: Create reverse DNS record (Hetzner Cloud)
hcloud_rdns:
token: MySecretToken
ip: 192.0.2.23
ptr: mail.example.com
delegate_to: localhost
Delegation is not strictly necessary, but it prevents the token from leaving the control system.
This does not work for IPv6 addresses that do not already have a reverse DNS record. This may be a limitation in the API.
This module creates reverse DNS records through the Hetzner Robot Webservice2.
- name: Create reverse DNS record (Hetzner Robot)
hetzner_rdns:
user: MyRobotWebserviceUsername
password: MySecretPassword
ip: 192.0.2.23
ptr: mail.example.com
delegate_to: localhost
As with the hcloud_rdns module, delegation is not required.
On success, both modules return the full response from the API. See the documentation (Cloud1, Robot2) for more information.