ansible.builtin.hcloud_rdns (v2.9.25) — module

Create and manage reverse DNS entries on the Hetzner Cloud.

| "added in version" 2.9 of ansible.builtin"

Authors: Lukas Kaemmerling (@lkaemmerling)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.25

Description

Create, update and delete reverse DNS entries on the Hetzner Cloud.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
state:
    choices:
    - absent
    - present
    default: present
    description:
    - State of the reverse DNS entry.
    type: str

server:
    description:
    - The name of the Hetzner Cloud server you want to add the reverse DNS entry to.
    required: true
    type: str

dns_ptr:
    description:
    - The DNS address the I(ip_address) should resolve to.
    - Omit the param to reset the reverse DNS entry to the default value.
    type: str

endpoint:
    default: https://api.hetzner.cloud/v1
    description:
    - This is the API Endpoint for the Hetzner Cloud.
    type: str

api_token:
    description:
    - This is the API Token for the Hetzner Cloud.
    required: true
    type: str

ip_address:
    description:
    - The IP address that should point to I(dns_ptr).
    required: true
    type: str

Outputs

hcloud_rdns:
  contains:
    dns_ptr:
      description: The DNS that resolves to the IP
      returned: always
      sample: example.com
      type: str
    ip_address:
      description: The IP address that point to the DNS ptr
      returned: always
      sample: 123.123.123.123
      type: str
    server:
      description: Name of the server
      returned: always
      sample: my-server
      type: str
  description: The reverse DNS entry
  returned: always
  type: complex

See also