community.dns.hetzner_dns_zone_info – Retrieve zone information in Hetzner DNS service

Note

This plugin is part of the community.dns collection (version 2.0.3).

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 community.dns.

To use it in a playbook, specify: community.dns.hetzner_dns_zone_info.

New in version 2.0.0: of community.dns

Synopsis

  • Retrieves zone information in Hetzner DNS service.

Parameters

Parameter Choices/Defaults Comments
hetzner_token
string / required
The token for the Hetzner API.
If not provided, will be read from the environment variable HETZNER_DNS_TOKEN.

aliases: api_token
zone_id
string
added in 0.2.0 of community.dns
The ID of the DNS zone to query.
Exactly one of zone_name and zone_id must be specified.
zone_name
string
The DNS zone to query.
Exactly one of zone_name and zone_id must be specified.

aliases: zone

Notes

Note

  • Supports check_mode.

Examples

- name: Retrieve details for foo.com zone
  community.dns.hetzner_dns_zone_info:
    zone: foo.com
    hetzner_token: access_token
  register: rec

- name: Retrieve details for zone 23
  community.dns.hetzner_dns_record:
    state: absent
    zone_id: 23
    hetzner_token: access_token

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
zone_id
string
success
The ID of the zone.

Sample:
23
zone_info
dictionary
success
Extra information returned by the API.

 
created
string
success
The time when the zone was created.

Sample:
2021-07-15T19:23:58Z
 
is_secondary_dns
boolean
success
Indicates whether the zone is a secondary DNS zone.

Sample:
True
 
legacy_dns_host
string
success
Unknown.

 
legacy_ns
list / elements=string
success
List of nameservers during import.

 
modified
string
success
The time the zone was last modified.

Sample:
2021-07-15T19:23:58Z
 
ns
list / elements=string
success
List of nameservers the zone should have for using Hetzner's DNS.

 
owner
string
success
Owner of the zone.

 
paused
boolean
success
Unknown.

Sample:
True
 
permission
string
success
Zone's permissions.

 
project
string
success
Unknown.

 
records_count
integer
success
Number of records associated to this zone.

 
registrar
string
success
Unknown.

 
status
string
success
Status of the zone.
Can be one of verified, failed and pending.

Sample:
verified
 
ttl
integer
success
TTL of zone.

 
txt_verification
dictionary
success
Shape of the TXT record that has to be set to verify a zone.
If name and token are empty, no TXT record needs to be set.

Sample:
{'name': '', 'token': ''}
   
name
string
success
The TXT record's name.

   
token
string
success
The TXT record's content.

 
verified
string
success
Time when zone was verified.

Sample:
2021-07-15T19:23:58Z
zone_name
integer
success
The name of the zone.

Sample:
example.com


Authors