felixfontein.hosttech_dns.hosttech_dns_record_info – Retrieve entries in Hosttech DNS service

Note

This plugin is part of the felixfontein.hosttech_dns collection (version 1.2.0).

To install it use: ansible-galaxy collection install felixfontein.hosttech_dns.

To use it in a playbook, specify: felixfontein.hosttech_dns.hosttech_dns_record_info.

New in version 1.0.0: of felixfontein.hosttech_dns

Synopsis

Requirements

The below requirements are needed on the host that executes this module.

  • lxml

Parameters

Parameter Choices/Defaults Comments
hosttech_password
string / required
The password for the Hosttech API user.
hosttech_username
string / required
The username for the Hosttech API user.
record
string
The full DNS record to retrieve.
Required if what is single_record or all_types_for_record.
type
string
    Choices:
  • A
  • CNAME
  • MX
  • AAAA
  • TXT
  • PTR
  • SRV
  • SPF
  • NS
  • CAA
The type of DNS record to retrieve.
Required if what is single_record.
what
string
    Choices:
  • single_record ←
  • all_types_for_record
  • all_records
Describes whether to fetch a single record and type combination, all types for a record, or all records. By default, a single record and type combination is fetched.
Note that the return value structure depends on this option.
zone
string / required
The DNS zone to modify.

Notes

Note

  • Supports check_mode.

Examples

- name: Retrieve the details for new.foo.com
  felixfontein.hosttech_dns.hosttech_dns_record_info:
    zone: foo.com
    record: new.foo.com
    type: A
    hosttech_username: foo
    hosttech_password: bar
  register: rec

- name: Delete new.foo.com A record using the results from the above command
  felixfontein.hosttech_dns.hosttech_dns_record:
    state: absent
    zone: foo.com
    record: "{{ rec.set.record }}"
    ttl: "{{ rec.set.ttl }}"
    type: "{{ rec.set.type }}"
    value: "{{ rec.set.value }}"
    hosttech_username: foo
    hosttech_password: bar

Return Values

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

Key Returned Description
set
dictionary
success and what is single_record
The fetched record. Is empty if record does not exist.

Sample:
{'record': 'sample.example.com', 'ttl': 3600, 'type': 'A', 'value': ['1.2.3.4', '1.2.3.5']}
 
record
string
success
The record name.

Sample:
sample.example.com
 
ttl
integer
success
The TTL.

Sample:
3600
 
type
string
success
The DNS record type.

Sample:
A
 
value
list / elements=string
success
The DNS record.

Sample:
['1.2.3.4', '1.2.3.5']
sets
list / elements=dictionary
success and what is not single_record
The list of fetched records.

Sample:
[{'record': 'sample.example.com', 'ttl': 3600, 'type': 'A', 'value': ['1.2.3.4', '1.2.3.5']}]
 
record
string
success
The record name.

Sample:
sample.example.com
 
ttl
integer
success
The TTL.

Sample:
3600
 
type
string
success
The DNS record type.

Sample:
A
 
value
list / elements=string
success
The DNS record.

Sample:
['1.2.3.4', '1.2.3.5']


Authors

  • Felix Fontein (@felixfontein)