ansible.builtin.dnsimple (v2.6.10) — module

Interface with dnsimple.com (a DNS hosting service).

| "added in version" 1.6 of ansible.builtin"

Authors: Alex Coomans (@drcapulet)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.6.10

Description

Manages domains and records via the DNSimple API, see the docs: U(http://developer.dnsimple.com/)


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# authenticate using email and API token and fetch all domains
- dnsimple:
    account_email: test@example.com
    account_api_token: dummyapitoken
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# fetch my.com domain records
- dnsimple:
    domain: my.com
    state: present
  delegate_to: localhost
  register: records
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# delete a domain
- dnsimple:
    domain: my.com
    state: absent
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# create a test.my.com A record to point to 127.0.0.01
- dnsimple:
    domain: my.com
    record: test
    type: A
    value: 127.0.0.1
  delegate_to: localhost
  register: record
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# and then delete it
- dnsimple:
    domain: my.com
    record_ids: '{{ record["id"] }}'
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# create a my.com CNAME record to example.com
- dnsimple:
    domain: my.com
    record: ''
    type: CNAME
    value: example.com
    state: present
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# change it's ttl
- dnsimple:
    domain: my.com
    record: ''
    type: CNAME
    value: example.com
    ttl: 600
    state: present
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# and delete the record
- dnsimple:
    domain: my.com
    record: ''
    type: CNAME
    value: example.com
    state: absent
  delegate_to: localhost

Inputs

    
ttl:
    default: 3600 (one hour)
    description:
    - The TTL to give the new record

solo:
    description:
    - Whether the record should be the only one for that record type and record name.
      Only use with state=present on a record

type:
    choices:
    - A
    - ALIAS
    - CNAME
    - MX
    - SPF
    - URL
    - TXT
    - NS
    - SRV
    - NAPTR
    - PTR
    - AAAA
    - SSHFP
    - HINFO
    - POOL
    description:
    - The type of DNS record to create

state:
    choices:
    - present
    - absent
    description:
    - whether the record should exist or not

value:
    description:
    - Record value
    - Must be specified when trying to ensure a record exists

domain:
    description:
    - Domain to work with. Can be the domain name (e.g. "mydomain.com") or the numeric
      ID of the domain in DNSimple. If omitted, a list of domains will be returned.
    - If domain is present but the domain doesn't exist, it will be created.

record:
    description:
    - Record to add, if blank a record for the domain will be created, supports the wildcard
      (*)

priority:
    description:
    - Record priority

record_ids:
    description:
    - List of records to ensure they either exist or don't exist

account_email:
    description:
    - 'Account email. If omitted, the env variables DNSIMPLE_EMAIL and DNSIMPLE_API_TOKEN
      will be looked for. If those aren''t found, a C(.dnsimple) file will be looked for,
      see: U(https://github.com/mikemaccana/dnsimple-python#getting-started)

      '

account_api_token:
    description:
    - Account API token. See I(account_email) for info.