community.general.dnsmadeeasy (8.5.0) — module

Interface with dnsmadeeasy.com (a DNS hosting service)

Authors: Brice Burgess (@briceburg)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

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/)


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Fetch my.com domain records
  community.general.dnsmadeeasy:
    account_key: key
    account_secret: secret
    domain: my.com
    state: present
  register: response
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Fetch a specific record
  community.general.dnsmadeeasy:
    account_key: key
    account_secret: secret
    domain: my.com
    state: present
    record_name: test
  register: response
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete a record
  community.general.dnsmadeeasy:
    account_key: key
    account_secret: secret
    domain: my.com
    record_type: A
    state: absent
    record_name: test
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
ip1:
    description:
    - Primary IP address for the failover.
    - Required if adding or changing the monitor or failover.
    type: str

ip2:
    description:
    - Secondary IP address for the failover.
    - Required if adding or changing the failover.
    type: str

ip3:
    description:
    - Tertiary IP address for the failover.
    type: str

ip4:
    description:
    - Quaternary IP address for the failover.
    type: str

ip5:
    description:
    - Quinary IP address for the failover.
    type: str

port:
    default: 80
    description:
    - Port used by the monitor.
    type: int

state:
    choices:
    - present
    - absent
    description:
    - whether the record should exist or not
    required: true
    type: str

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
    type: str

monitor:
    default: false
    description:
    - If V(true), add or change the monitor.  This is applicable only for A records.
    type: bool

sandbox:
    default: false
    description:
    - Decides if the sandbox API should be used. Otherwise (default) the production API
      of DNS Made Easy is used.
    type: bool

failover:
    default: false
    description:
    - If V(true), 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.
    type: str

httpFqdn:
    description:
    - The fully qualified domain name used by the monitor.
    type: str

protocol:
    choices:
    - TCP
    - UDP
    - HTTP
    - DNS
    - SMTP
    - HTTPS
    default: HTTP
    description:
    - Protocol used by the monitor.
    type: str

maxEmails:
    default: 1
    description:
    - Number of emails sent to the contact list by the monitor.
    type: int

record_ttl:
    default: 1800
    description:
    - record's "Time to live".  Number of seconds the record remains cached in DNS servers.
    type: int

account_key:
    description:
    - Account API Key.
    required: true
    type: str

contactList:
    description:
    - Name or id of the contact list that the monitor will notify.
    - The default V('') means the Account Owner.
    type: str

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.
    type: str

record_type:
    choices:
    - A
    - AAAA
    - CNAME
    - ANAME
    - HTTPRED
    - MX
    - NS
    - PTR
    - SRV
    - TXT
    description:
    - Record type.
    type: str

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.
    type: str

autoFailover:
    default: false
    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)

      '
    type: str

account_secret:
    description:
    - Account Secret Key.
    required: true
    type: str

validate_certs:
    default: true
    description:
    - If V(false), 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.
    type: str

systemDescription:
    default: ''
    description:
    - Description used by the monitor.
    type: str