W3cubDocs

/Ansible

exo_dns_record - Manages DNS records on Exoscale DNS.

New in version 2.2.

Synopsis

  • Create, update and delete records.

Requirements (on host that executes module)

  • python >= 2.6

Options

parameter required default choices comments
api_key
no
API key of the Exoscale DNS API.
Since 2.4, the ENV variable CLOUDSTACK_KEY is used as default, when defined.
api_region
no cloudstack
Name of the ini section in the cloustack.ini file.
Since 2.4, the ENV variable CLOUDSTACK_REGION is used as default, when defined.
api_secret
no
Secret key of the Exoscale DNS API.
Since 2.4, the ENV variable CLOUDSTACK_SECRET is used as default, when defined.
api_timeout
no 10
HTTP timeout to Exoscale DNS API.
Since 2.4, the ENV variable CLOUDSTACK_TIMEOUT is used as default, when defined.
content
no
Content of the record.
Required if state=present or name=""
aliases: value, address
domain
yes
Domain the record is related to.
multiple
no
Whether there are more than one records with similar name.
Only allowed with record_type=A.
content will not be updated as it is used as key to find the record.
aliases: priority
name
no
Name of the record.
prio
no
Priority of the record.
aliases: priority
record_type
no A
  • A
  • ALIAS
  • CNAME
  • MX
  • SPF
  • URL
  • TXT
  • NS
  • SRV
  • NAPTR
  • PTR
  • AAAA
  • SSHFP
  • HINFO
  • POOL
Type of the record.
aliases: rtype, type
state
no present
  • present
  • absent
State of the record.
ttl
no 3600
TTL of the record in seconds.
validate_certs
no True
  • yes
  • no
Validate SSL certs of the Exoscale DNS API.

Examples

- name: Create or update an A record
  local_action:
    module: exo_dns_record
    name: web-vm-1
    domain: example.com
    content: 1.2.3.4

- name: Update an existing A record with a new IP
  local_action:
    module: exo_dns_record
    name: web-vm-1
    domain: example.com
    content: 1.2.3.5

- name: Create another A record with same name
  local_action:
    module: exo_dns_record
    name: web-vm-1
    domain: example.com
    content: 1.2.3.6
    multiple: yes

- name: Create or update a CNAME record
  local_action:
    module: exo_dns_record
    name: www
    domain: example.com
    record_type: CNAME
    content: web-vm-1

- name: Create or update a MX record
  local_action:
    module: exo_dns_record
    domain: example.com
    record_type: MX
    content: mx1.example.com
    prio: 10

- name: Delete a MX record
  local_action:
    module: exo_dns_record
    domain: example.com
    record_type: MX
    content: mx1.example.com
    state: absent

- name: Remove a record
  local_action:
    module: exo_dns_record
    name: www
    domain: example.com
    state: absent

Return Values

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

name description returned type sample
exo_dns_record
API record results
success complex
contains:
name description returned type sample
domain
Name of the domain
success string example.com
name
name of the record
success string www
prio
Priority of the record
success int 10
parent_id
ID of the parent
success int None
system_record
Whether the record is a system record or not
success bool False
created_at
When the record was created
success string 2016-08-12T15:24:23.989Z
updated_at
When the record was updated
success string 2016-08-12T15:24:23.989Z
id
ID of the record
success int 254324
content
value of the record
success string 1.2.3.4
record_type
Priority of the record
success string A
ttl
Time to live of the record
success int 3600
domain_id
ID of the domain
success int 254324

Notes

Note

  • As Exoscale DNS uses the same API key and secret for all services, we reuse the config used for Exscale Compute based on CloudStack. The config is read from several locations, in the following order. The CLOUDSTACK_KEY, CLOUDSTACK_SECRET environment variables. A CLOUDSTACK_CONFIG environment variable pointing to an .ini file, A cloudstack.ini file in the current working directory. A .cloudstack.ini file in the users home directory. Optionally multiple credentials and endpoints can be specified using ini sections in cloudstack.ini. Use the argument api_region to select the section name, default section is cloudstack.
  • This module does not support multiple A records and will complain properly if you try.
  • More information Exoscale DNS can be found on https://community.exoscale.ch/documentation/dns/.
  • This module supports check mode and diff.

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/exo_dns_record_module.html