W3cubDocs

/Ansible 2.9

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

Synopsis

Requirements

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

  • dnsimple >= 1.0.0

Parameters

Parameter Choices/Defaults Comments
account_api_token
string
Account API token. See account_email for more information.
account_email
string
Account email. If omitted, the environment 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
string
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
integer
Record priority.
record
string
Record to add, if blank a record for the domain will be created, supports the wildcard (*).
record_ids
list
List of records to ensure they either exist or do not exist.
solo
boolean
    Choices:
  • no
  • yes
Whether the record should be the only one for that record type and record name.
Only use with state is set to present on a record.
state
string
    Choices:
  • present
  • absent
whether the record should exist or not.
ttl
integer
Default:
3600
The TTL to give the new record in seconds.
type
string
    Choices:
  • A
  • ALIAS
  • CNAME
  • MX
  • SPF
  • URL
  • TXT
  • NS
  • SRV
  • NAPTR
  • PTR
  • AAAA
  • SSHFP
  • HINFO
  • POOL
The type of DNS record to create.
value
string
Record value.
Must be specified when trying to ensure a record exists.

Notes

Note

  • DNSimple API v1 is deprecated. Please install dnsimple-python>=1.0.0 which uses v2 API.

Examples

- name: Authenticate using email and API token and fetch all domains
  dnsimple:
    account_email: [email protected]
    account_api_token: dummyapitoken
  delegate_to: localhost

- name: Fetch my.com domain records
  dnsimple:
    domain: my.com
    state: present
  delegate_to: localhost
  register: records

- name: Delete a domain
  dnsimple:
    domain: my.com
    state: absent
  delegate_to: localhost

- name: Create a test.my.com A record to point to 127.0.0.1
  dnsimple:
    domain: my.com
    record: test
    type: A
    value: 127.0.0.1
  delegate_to: localhost
  register: record

- name: Delete record using record_ids
  dnsimple:
    domain: my.com
    record_ids: '{{ record["id"] }}'
    state: absent
  delegate_to: localhost

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

- name: change TTL value for a record
  dnsimple:
    domain: my.com
    record: ''
    type: CNAME
    value: example.com
    ttl: 600
    state: present
  delegate_to: localhost

- name: Delete the record
  dnsimple:
    domain: my.com
    record: ''
    type: CNAME
    value: example.com
    state: absent
  delegate_to: localhost

Status

Authors

  • Alex Coomans (@drcapulet)

Hint

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

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/dnsimple_module.html