community.general.dnsmadeeasy module – Interface with dnsmadeeasy.com (a DNS hosting service)
Note
This module is part of the community.general collection (version 11.4.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 community.general.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.general.dnsmadeeasy.
Synopsis
- Manages DNS records using the v2 REST API of the DNS Made Easy service. It handles records only; there is no manipulation of domains or monitor/account support yet. See: https://www.dnsmadeeasy.com/integration/restapi/. 
Requirements
The below requirements are needed on the host that executes this module.
- hashlib 
- hmac 
Parameters
| Parameter | Comments | 
|---|---|
| Account API Key. | |
| Account Secret Key. | |
| If true, fallback to the primary IP address is manual after a failover. If false, fallback to the primary IP address is automatic after a failover. Choices: 
 | |
| Name or ID of the contact list that the monitor notifies. The default  | |
| Domain to work with. Can be the domain name (for example  | |
| If  Choices: 
 | |
| The file at the Fqdn that the monitor queries for HTTP or HTTPS. | |
| The fully qualified domain name used by the monitor. | |
| The string in the httpFile that the monitor queries for HTTP or HTTPS. | |
| Primary IP address for the failover. Required if adding or changing the monitor or failover. | |
| Secondary IP address for the failover. Required if adding or changing the failover. | |
| Tertiary IP address for the failover. | |
| Quaternary IP address for the failover. | |
| Quinary IP address for the failover. | |
| Number of emails sent to the contact list by the monitor. Default:  | |
| If  Choices: 
 | |
| Port used by the monitor. Default:  | |
| Protocol used by the monitor. Choices: 
 | |
| Record name to get/create/delete/update. If  | |
| Record’s “Time-To-Live”. Number of seconds the record remains cached in DNS servers. Default:  | |
| Record type. Choices: 
 | |
| Record value. HTTPRED: <redirection URL>, MX: <priority> <target name>, NS: <name server>, PTR: <target name>, SRV: <priority> <weight> <port> <target name>, TXT: <text value>”. If  | |
| Decides if the sandbox API should be used. Otherwise (default) the production API of DNS Made Easy is used. Choices: 
 | |
| Number of checks the monitor performs before a failover occurs where Low = 8, Medium = 5,and High = 3. Choices: 
 | |
| Whether the record should exist or not. Choices: 
 | |
| Description used by the monitor. Default:  | |
| If  Choices: 
 | 
Attributes
| Attribute | Support | Description | 
|---|---|---|
| Support: none | Can run in  | |
| Support: none | Returns details on what has changed (or possibly needs changing in  | 
Notes
Note
- The DNS Made Easy service requires that machines interacting with the API have the proper time and timezone set. Be sure you are within a few seconds of actual time by using NTP. 
- This module returns record(s) and monitor(s) in the - resultelement when- state=present. These values can be be registered and used in your playbooks.
- To add failover, the - failover,- autoFailover,- port,- protocol,- ip1, and- ip2options are required.
- To add monitor, the - monitor,- port,- protocol,- maxEmails,- systemDescription, and- ip1options are required.
- The options - monitorand- failovershare- port,- protocol, and- ip1options.
Examples
- name: Fetch my.com domain records
  community.general.dnsmadeeasy:
    account_key: key
    account_secret: secret
    domain: my.com
    state: present
  register: response
- name: Create a record
  community.general.dnsmadeeasy:
    account_key: key
    account_secret: secret
    domain: my.com
    state: present
    record_name: test
    record_type: A
    record_value: 127.0.0.1
- name: Update the previously created record
  community.general.dnsmadeeasy:
    account_key: key
    account_secret: secret
    domain: my.com
    state: present
    record_name: test
    record_value: 192.0.2.23
- name: Fetch a specific record
  community.general.dnsmadeeasy:
    account_key: key
    account_secret: secret
    domain: my.com
    state: present
    record_name: test
  register: response
- name: Delete a record
  community.general.dnsmadeeasy:
    account_key: key
    account_secret: secret
    domain: my.com
    record_type: A
    state: absent
    record_name: test
- name: Add a failover
  community.general.dnsmadeeasy:
    account_key: key
    account_secret: secret
    domain: my.com
    state: present
    record_name: test
    record_type: A
    record_value: 127.0.0.1
    failover: true
    ip1: 127.0.0.2
    ip2: 127.0.0.3
- name: Add a failover
  community.general.dnsmadeeasy:
    account_key: key
    account_secret: secret
    domain: my.com
    state: present
    record_name: test
    record_type: A
    record_value: 127.0.0.1
    failover: true
    ip1: 127.0.0.2
    ip2: 127.0.0.3
    ip3: 127.0.0.4
    ip4: 127.0.0.5
    ip5: 127.0.0.6
- name: Add a monitor
  community.general.dnsmadeeasy:
    account_key: key
    account_secret: secret
    domain: my.com
    state: present
    record_name: test
    record_type: A
    record_value: 127.0.0.1
    monitor: true
    ip1: 127.0.0.2
    protocol: HTTP # default
    port: 80 # default
    maxEmails: 1
    systemDescription: Monitor Test A record
    contactList: my contact list
- name: Add a monitor with http options
  community.general.dnsmadeeasy:
    account_key: key
    account_secret: secret
    domain: my.com
    state: present
    record_name: test
    record_type: A
    record_value: 127.0.0.1
    monitor: true
    ip1: 127.0.0.2
    protocol: HTTP # default
    port: 80 # default
    maxEmails: 1
    systemDescription: Monitor Test A record
    contactList: 1174 # contact list id
    httpFqdn: http://my.com
    httpFile: example
    httpQueryString: some string
- name: Add a monitor and a failover
  community.general.dnsmadeeasy:
    account_key: key
    account_secret: secret
    domain: my.com
    state: present
    record_name: test
    record_type: A
    record_value: 127.0.0.1
    failover: true
    ip1: 127.0.0.2
    ip2: 127.0.0.3
    monitor: true
    protocol: HTTPS
    port: 443
    maxEmails: 1
    systemDescription: monitoring my.com status
    contactList: emergencycontacts
- name: Remove a failover
  community.general.dnsmadeeasy:
    account_key: key
    account_secret: secret
    domain: my.com
    state: present
    record_name: test
    record_type: A
    record_value: 127.0.0.1
    failover: false
- name: Remove a monitor
  community.general.dnsmadeeasy:
    account_key: key
    account_secret: secret
    domain: my.com
    state: present
    record_name: test
    record_type: A
    record_value: 127.0.0.1
    monitor: false
