community.dns.hosttech_dns_record_info (1.2.3) — module

Retrieve entries in Hosttech DNS service

| "added in version" 0.1.0 of community.dns"

Authors: Felix Fontein (@felixfontein)

Install collection

Install with ansible-galaxy collection install community.dns:==1.2.3


Add to requirements.yml

  collections:
    - name: community.dns
      version: 1.2.3

Description

Retrieves DNS records in Hosttech DNS service.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve the details for new.foo.com
  community.dns.hosttech_dns_record_info:
    zone: foo.com
    record: new.foo.com
    type: A
    hosttech_token: access_token
  register: rec
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete new.foo.com A record using the results from the above command
  community.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

Inputs

    
type:
    choices:
    - A
    - CNAME
    - MX
    - AAAA
    - TXT
    - PTR
    - SRV
    - SPF
    - NS
    - CAA
    description:
    - The type of DNS record to retrieve.
    - Required if I(what) is C(single_record).
    type: str

what:
    choices:
    - single_record
    - all_types_for_record
    - all_records
    default: single_record
    description:
    - 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.
    type: str

zone:
    description:
    - The DNS zone to modify.
    - Exactly one of I(zone) and I(zone_id) must be specified.
    type: str

prefix:
    description:
    - The prefix of the DNS record.
    - This is the part of I(record) before I(zone). For example, if the record to be modified
      is C(www.example.com) for the zone C(example.com), the prefix is C(www). If the
      record in this example would be C(example.com), the prefix would be C('') (empty
      string).
    - If I(what) is C(single_record) or C(all_types_for_record), exactly one of I(record)
      and I(prefix) is required.
    type: str
    version_added: 0.2.0
    version_added_collection: community.dns

record:
    description:
    - The full DNS record to retrieve.
    - If I(what) is C(single_record) or C(all_types_for_record), exactly one of I(record)
      and I(prefix) is required.
    type: str

zone_id:
    description:
    - The ID of the DNS zone to modify.
    - Exactly one of I(zone) and I(zone_id) must be specified.
    type: int
    version_added: 0.2.0
    version_added_collection: community.dns

hosttech_token:
    aliases:
    - api_token
    description:
    - The password for the Hosttech API user.
    - Mutually exclusive with I(hosttech_username) and I(hosttech_password).
    - Since community.dns 1.2.0, the alias I(api_token) can be used.
    type: str
    version_added: 0.2.0
    version_added_collection: community.dns

hosttech_password:
    description:
    - The password for the Hosttech API user.
    - If provided, I(hosttech_username) must also be provided.
    - Mutually exclusive with I(hosttech_token).
    type: str

hosttech_username:
    description:
    - The username for the Hosttech API user.
    - If provided, I(hosttech_password) must also be provided.
    - Mutually exclusive with I(hosttech_token).
    type: str

Outputs

set:
  contains:
    prefix:
      description: The record prefix.
      sample: sample
      type: str
      version_added: 0.2.0
      version_added_collection: community.dns
    record:
      description: The record name.
      sample: sample.example.com
      type: str
    ttl:
      description: The TTL.
      sample: 3600
      type: int
    type:
      description: The DNS record type.
      sample: A
      type: str
    value:
      description: The DNS record.
      elements: str
      sample:
      - 1.2.3.4
      - 1.2.3.5
      type: list
  description: The fetched record. Is empty if record does not exist.
  returned: success and I(what) is C(single_record)
  sample:
    record: sample.example.com
    ttl: 3600
    type: A
    value:
    - 1.2.3.4
    - 1.2.3.5
  type: dict
sets:
  contains:
    prefix:
      description: The record prefix.
      sample: sample
      type: str
      version_added: 0.2.0
      version_added_collection: community.dns
    record:
      description: The record name.
      sample: sample.example.com
      type: str
    ttl:
      description: The TTL.
      sample: 3600
      type: int
    type:
      description: The DNS record type.
      sample: A
      type: str
    value:
      description: The DNS record.
      elements: str
      sample:
      - 1.2.3.4
      - 1.2.3.5
      type: list
  description: The list of fetched records.
  elements: dict
  returned: success and I(what) is not C(single_record)
  sample:
  - record: sample.example.com
    ttl: 3600
    type: A
    value:
    - 1.2.3.4
    - 1.2.3.5
  type: list
zone_id:
  description: The ID of the zone.
  returned: success
  sample: 23
  type: int
  version_added: 0.2.0
  version_added_collection: community.dns