ngine_io.exoscale.exo_dns_record module – Manages DNS records on Exoscale DNS.
Note
This module is part of the ngine_io.exoscale collection (version 1.0.0).
You might already have this collection installed if you are using the ansible
package.
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 ngine_io.exoscale
.
To use it in a playbook, specify: ngine_io.exoscale.exo_dns_record
.
New in version 0.1.0: of ngine_io.exoscale
Requirements
The below requirements are needed on the host that executes this module.
python >= 2.6
Parameters
Parameter |
Comments |
---|---|
API key of the Exoscale DNS API. The ENV variable |
|
Name of the ini section in the The ENV variable Default: “cloudstack” |
|
Secret key of the Exoscale DNS API. The ENV variable |
|
HTTP timeout to Exoscale DNS API. The ENV variable Default: 10 |
|
Content of the record. Required if |
|
Domain the record is related to. |
|
Whether there are more than one records with similar name and record_type. Only allowed for a few record types, e.g. content will not be updated, instead it is used as a key to find existing records. Choices:
|
|
Name of the record. Default: “” |
|
Priority of the record. |
|
Type of the record. Choices:
|
|
State of the record. Choices:
|
|
TTL of the record in seconds. Default: 3600 |
|
Validate SSL certs of the Exoscale DNS API. Choices:
|
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. ACLOUDSTACK_CONFIG
environment variable pointing to an.ini
file, Acloudstack.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 incloudstack.ini
. Use the argumentapi_region
to select the section name, default section iscloudstack
.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.
Examples
- name: Create or update an A record
ngine_io.exoscale.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
ngine_io.exoscale.exo_dns_record:
name: web-vm-1
domain: example.com
content: 1.2.3.5
- name: Create another A record with same name
ngine_io.exoscale.exo_dns_record:
name: web-vm-1
domain: example.com
content: 1.2.3.6
multiple: yes
- name: Create or update a CNAME record
ngine_io.exoscale.exo_dns_record:
name: www
domain: example.com
record_type: CNAME
content: web-vm-1
- name: Create another MX record
ngine_io.exoscale.exo_dns_record:
domain: example.com
record_type: MX
content: mx1.example.com
prio: 10
multiple: yes
- name: Delete one MX record out of multiple
ngine_io.exoscale.exo_dns_record:
domain: example.com
record_type: MX
content: mx1.example.com
multiple: yes
state: absent
- name: Remove a single A record
ngine_io.exoscale.exo_dns_record:
name: www
domain: example.com
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
API record results Returned: success |
|
value of the record Returned: success Sample: “1.2.3.4” |
|
When the record was created Returned: success Sample: “2016-08-12T15:24:23.989Z” |
|
Name of the domain Returned: success Sample: “example.com” |
|
ID of the domain Returned: success Sample: 254324 |
|
ID of the record Returned: success Sample: 254324 |
|
name of the record Returned: success Sample: “www” |
|
ID of the parent Returned: success |
|
Priority of the record Returned: success Sample: 10 |
|
Priority of the record Returned: success Sample: “A” |
|
Whether the record is a system record or not Returned: success Sample: false |
|
Time to live of the record Returned: success Sample: 3600 |
|
When the record was updated Returned: success Sample: “2016-08-12T15:24:23.989Z” |
Authors
René Moser (@resmo)