domain_record

Synopsis

Requirements

  • pydo >= 0.1.3
  • azure-core >= 1.26.1

Parameters

Parameter Choices Default Comments
client_override_options
(dict)
Client override options (developer use). For example, can be used to override the DigitalOcean API endpoint for an internal test suite. If provided, these options will knock out existing options.
data
(str)
Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the CA being granted permission to issue certificates.
domain_name
(str)
The domain name.
flags
(int)
An unsigned integer between 0-255 used for CAA records.
module_override_options
(dict)
Module override options (developer use). Can be used to override module options to support experimental or future options. If provided, these options will knock out existing options.
name
(str)
The host name, alias, or service being defined by the record.
port
(int)
The port for SRV records.
priority
(int)
The priority for SRV and MX records.
state
(str)
  • present
  • absent
present State of the resource, present to create, absent to destroy.
tag
(str)
  • issue
  • issuewild
  • iodef
The parameter tag for CAA records.
timeout
(int)
300 Polling timeout in seconds.
token
(str)
DigitalOcean API token. There are several environment variables which can be used to provide this value. DIGITALOCEAN_ACCESS_TOKEN, DIGITALOCEAN_TOKEN, DO_API_TOKEN, DO_API_KEY, DO_OAUTH_TOKEN and OAUTH_TOKEN
ttl
(int)
This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh kshould be requested.
type
(str)
  • A
  • AAAA
  • CAA
  • CNAME
  • MX
  • NS
  • SOA
  • SRV
  • TXT
The type of the DNS record.
weight
(int)
The weight for SRV records.

Examples

- name: Create domain A record
  digitalocean.cloud.domain_record:
    token: "{{ token }}"
    domain_name: example.com
    type: A
    name: www
    data: 192.168.100.50

Return Values

Key Returned Description
domain_record
(dict)
always Domain record.

Sample:

{
  "domain_record": {
    "data": "192.168.100.50",
    "flags": null,
    "id": 28448433,
    "name": "www.example.com",
    "port": null,
    "priority": null,
    "tag": null,
    "ttl": 1800,
    "type": "A",
    "weight": null
  }
}
error
(dict)
failure DigitalOcean API error.

Sample:

{
  "Message": "Informational error message.",
  "Reason": "Unauthorized",
  "Status Code": 401
}
msg
(str)
always Domain record result information.

Sample:

[
  "Created domain record www A in example.com",
  "Deleted domain record www A in example.com",
  "Domain record www A exists in example.com",
  "Domain record www A would be created in example.com",
  "Domain record www A would be deleted from example.com",
  "Domain record www A does not exist in example.com"
]