Documentation

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

New in version 1.6.

Synopsis

Requirements

The below requirements are needed on the host that executes this module.

  • dnsimple

Parameters

Parameter
Choices/Defaults
Comments
account_api_token
Account API token. See account_email for info.
account_email
Account email. If omitted, the env variables DNSIMPLE_EMAIL and DNSIMPLE_API_TOKEN will be looked for. If those aren't found, a .dnsimple file will be looked for, see: https://github.com/mikemaccana/dnsimple-python#getting-started
domain
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.
priority
Record priority
record
Record to add, if blank a record for the domain will be created, supports the wildcard (*)
record_ids
List of records to ensure they either exist or don't exist
solo
Whether the record should be the only one for that record type and record name. Only use with state=present on a record
state
    Choices:
  • present
  • absent
whether the record should exist or not
ttl
Default:
3600 (one hour)
The TTL to give the new record
type
    Choices:
  • A
  • ALIAS
  • CNAME
  • MX
  • SPF
  • URL
  • TXT
  • NS
  • SRV
  • NAPTR
  • PTR
  • AAAA
  • SSHFP
  • HINFO
  • POOL
The type of DNS record to create
value
Record value
Must be specified when trying to ensure a record exists

Examples

# authenticate using email and API token and fetch all domains
- dnsimple:
    account_email: test@example.com
    account_api_token: dummyapitoken
  delegate_to: localhost

# fetch my.com domain records
- dnsimple:
    domain: my.com
    state: present
  delegate_to: localhost
  register: records

# delete a domain
- dnsimple:
    domain: my.com
    state: absent
  delegate_to: localhost

# 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

# and then delete it
- dnsimple:
    domain: my.com
    record_ids: '{{ record["id"] }}'
  delegate_to: localhost

# create a my.com CNAME record to example.com
- dnsimple:
    domain: my.com
    record: ''
    type: CNAME
    value: example.com
    state: present
  delegate_to: localhost

# change it's ttl
- dnsimple:
    domain: my.com
    record: ''
    type: CNAME
    value: example.com
    ttl: 600
    state: present
  delegate_to: localhost

# and delete the record
- dnsimple:
    domain: my.com
    record: ''
    type: CNAME
    value: example.com
    state: absent
  delegate_to: localhost

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Author

  • Alex Coomans (@drcapulet)

Hint

If you notice any issues in this documentation you can edit this document to improve it.