damex.cloudflare.cloudflare_dns_record_info module – Ensure Cloudflare DNS record information is gathered

Note

This module is part of the damex.cloudflare collection (version 1.2.3).

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 damex.cloudflare.

To use it in a playbook, specify: damex.cloudflare.cloudflare_dns_record_info.

Synopsis

  • Gathers information about Cloudflare DNS records for a zone.

  • Returns all records or filters by type and name.

Parameters

Parameter

Comments

account_api_key

string

Cloudflare account API key.

Required together with account_email if api_token is not provided.

account_email

string

Cloudflare account email.

Required together with account_api_key if api_token is not provided.

api_token

string

Cloudflare API token.

Required if account_email and account_api_key are not provided.

Can be specified in CLOUDFLARE_TOKEN environment variable.

record

string

DNS record name to filter by.

type

string

DNS record type to filter by.

Choices:

  • "A"

  • "AAAA"

  • "CAA"

  • "CNAME"

  • "DS"

  • "HTTPS"

  • "MX"

  • "NAPTR"

  • "NS"

  • "PTR"

  • "SMIMEA"

  • "SRV"

  • "SSHFP"

  • "SVCB"

  • "TLSA"

  • "TXT"

  • "URI"

zone_id

string

Zone identifier.

Required if zone_name is not provided.

zone_name

string

Zone domain name.

Required if zone_id is not provided.

Resolved to zone identifier via the Cloudflare API.

Attributes

Attribute

Support

Description

check_mode

Support: full

Supports check mode.

diff_mode

Support: none

Does not support diff mode.

Examples

- name: Ensure all DNS record information is gathered
  damex.cloudflare.cloudflare_dns_record_info:
    zone_name: example.com
    api_token: "{{ cloudflare_api_token }}"
  register: cloudflare_dns_record_information

- name: Ensure A record information is gathered
  damex.cloudflare.cloudflare_dns_record_info:
    zone_name: example.com
    api_token: "{{ cloudflare_api_token }}"
    record: www
    type: A
  register: cloudflare_dns_record_information

Return Values

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

Key

Description

records

list / elements=dictionary

DNS record information.

Returned: always

content

string

Record content.

Returned: always

id

string

Record identifier.

Returned: always

name

string

Record name.

Returned: always

proxied

boolean

Proxy status.

Returned: always

ttl

integer

Record TTL.

Returned: always

type

string

Record type.

Returned: always

Authors

  • Roman Kuzmitskii (@damex)