community / community.general / 0.1.1 / module / dnsmadeeasy Interface with dnsmadeeasy.com (a DNS hosting service). Authors: Brice Burgess (@briceburg) preview | supported by communitycommunity.general.dnsmadeeasy (0.1.1) — module
Install with ansible-galaxy collection install community.general:==0.1.1
collections: - name: community.general version: 0.1.1
Manages DNS records via 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: U(https://www.dnsmadeeasy.com/integration/restapi/)
# fetch my.com domain records - dnsmadeeasy: account_key: key account_secret: secret domain: my.com state: present register: response
# create / ensure the presence of a record - dnsmadeeasy: account_key: key account_secret: secret domain: my.com state: present record_name: test record_type: A record_value: 127.0.0.1
# update the previously created record - dnsmadeeasy: account_key: key account_secret: secret domain: my.com state: present record_name: test record_value: 192.0.2.23
# fetch a specific record - dnsmadeeasy: account_key: key account_secret: secret domain: my.com state: present record_name: test register: response
# delete a record / ensure it is absent - dnsmadeeasy: account_key: key account_secret: secret domain: my.com record_type: A state: absent record_name: test
# Add a failover - 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
- 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
# Add a monitor - 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: yes ip1: 127.0.0.2 protocol: HTTP # default port: 80 # default maxEmails: 1 systemDescription: Monitor Test A record contactList: my contact list
# Add a monitor with http options - 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: yes 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
# Add a monitor and a failover - 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: yes protocol: HTTPS port: 443 maxEmails: 1 systemDescription: monitoring my.com status contactList: emergencycontacts
# Remove a failover - 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: no
# Remove a monitor - 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: no
ip1: description: - Primary IP address for the failover. - Required if adding or changing the monitor or failover. ip2: description: - Secondary IP address for the failover. - Required if adding or changing the failover. ip3: description: - Tertiary IP address for the failover. ip4: description: - Quaternary IP address for the failover. ip5: description: - Quinary IP address for the failover. port: default: 80 description: - Port used by the monitor. required: true state: choices: - present - absent description: - whether the record should exist or not required: true domain: description: - Domain to work with. Can be the domain name (e.g. "mydomain.com") or the numeric ID of the domain in DNS Made Easy (e.g. "839989") for faster resolution required: true monitor: default: 'no' description: - If C(yes), add or change the monitor. This is applicable only for A records. type: bool sandbox: default: 'no' description: - Decides if the sandbox API should be used. Otherwise (default) the production API of DNS Made Easy is used. type: bool failover: default: 'no' description: - If C(yes), add or change the failover. This is applicable only for A records. type: bool httpFile: description: - The file at the Fqdn that the monitor queries for HTTP or HTTPS. httpFqdn: description: - The fully qualified domain name used by the monitor. protocol: choices: - TCP - UDP - HTTP - DNS - SMTP - HTTPS default: HTTP description: - Protocol used by the monitor. required: true maxEmails: default: 1 description: - Number of emails sent to the contact list by the monitor. required: true record_ttl: default: 1800 description: - record's "Time to live". Number of seconds the record remains cached in DNS servers. account_key: description: - Account API Key. required: true contactList: default: '' description: - Name or id of the contact list that the monitor will notify. - The default C('') means the Account Owner. required: true record_name: description: - Record name to get/create/delete/update. If record_name is not specified; all records for the domain will be returned in "result" regardless of the state argument. record_type: choices: - A - AAAA - CNAME - ANAME - HTTPRED - MX - NS - PTR - SRV - TXT description: - Record type. sensitivity: choices: - Low - Medium - High default: Medium description: - Number of checks the monitor performs before a failover occurs where Low = 8, Medium = 5,and High = 3. required: true autoFailover: default: 'no' description: - 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. type: bool record_value: description: - '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 record_value is not specified; no changes will be made and the record will be returned in ''result'' (in other words, this module can be used to fetch a record''s current id, type, and ttl) ' account_secret: description: - Account Secret Key. required: true validate_certs: default: 'yes' description: - If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool httpQueryString: description: - The string in the httpFile that the monitor queries for HTTP or HTTPS. systemDescription: default: '' description: - Description used by the monitor. required: true