community.general.dnsimple (8.5.0) — module

Interface with dnsimple.com (a DNS hosting service)

Authors: Alex Coomans (@drcapulet)

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 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.
- name: Authenticate using email and API token and fetch all domains
  community.general.dnsimple:
    account_email: test@example.com
    account_api_token: dummyapitoken
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete a domain
  community.general.dnsimple:
    domain: my.com
    state: absent
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a test.my.com A record to point to 127.0.0.1
  community.general.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.
- name: Delete record using record_ids
  community.general.dnsimple:
    domain: my.com
    record_ids: '{{ record["id"] }}'
    state: absent
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a my.com CNAME record to example.com
  community.general.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.
- name: Change TTL value for a record
  community.general.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.
- name: Delete the record
  community.general.dnsimple:
    domain: my.com
    record: ''
    type: CNAME
    value: example.com
    state: absent
  delegate_to: localhost

Inputs

    
ttl:
    default: 3600
    description:
    - The TTL to give the new record in seconds.
    type: int

solo:
    default: false
    description:
    - Whether the record should be the only one for that record type and record name.
    - Only use with O(state) is set to V(present) on a record.
    type: bool

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

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

value:
    description:
    - Record value.
    - Must be specified when trying to ensure a record exists.
    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 DNSimple.
    - If omitted, a list of domains will be returned.
    - If domain is present but the domain doesn't exist, it will be created.
    type: str

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

sandbox:
    default: false
    description:
    - Use the DNSimple sandbox environment.
    - Requires a dedicated account in the dnsimple sandbox environment.
    - Check U(https://developer.dnsimple.com/sandbox/) for more information.
    type: bool
    version_added: 3.5.0
    version_added_collection: community.general

priority:
    description:
    - Record priority.
    type: int

record_ids:
    description:
    - List of records to ensure they either exist or do not exist.
    elements: str
    type: list

account_email:
    description:
    - Account email. If omitted, the environment variables E(DNSIMPLE_EMAIL) and E(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).'
    - C(.dnsimple) config files are only supported in dnsimple-python<2.0.0
    type: str

account_api_token:
    description:
    - Account API token. See O(account_email) for more information.
    type: str