community.general.exo_dns_record (0.1.4) — module

Manages DNS records on Exoscale DNS.

Authors: René Moser (@resmo)

Install collection

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


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.4

Description

Create, update and delete records.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create or update an A record
  exo_dns_record:
    name: web-vm-1
    domain: example.com
    content: 1.2.3.4
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Update an existing A record with a new IP
  exo_dns_record:
    name: web-vm-1
    domain: example.com
    content: 1.2.3.5
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create another A record with same name
  exo_dns_record:
    name: web-vm-1
    domain: example.com
    content: 1.2.3.6
    multiple: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create or update a CNAME record
  exo_dns_record:
    name: www
    domain: example.com
    record_type: CNAME
    content: web-vm-1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create another MX record
  exo_dns_record:
    domain: example.com
    record_type: MX
    content: mx1.example.com
    prio: 10
    multiple: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete one MX record out of multiple
  exo_dns_record:
    domain: example.com
    record_type: MX
    content: mx1.example.com
    multiple: yes
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove a single A record
  exo_dns_record:
    name: www
    domain: example.com
    state: absent

Inputs

    
ttl:
    default: 3600
    description:
    - TTL of the record in seconds.
    type: int

name:
    default: ''
    description:
    - Name of the record.
    type: str

prio:
    aliases:
    - priority
    description:
    - Priority of the record.
    type: int

state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the record.
    type: str

domain:
    description:
    - Domain the record is related to.
    required: true
    type: str

api_key:
    description:
    - API key of the Exoscale DNS API.
    - Since 2.4, the ENV variable C(CLOUDSTACK_KEY) is used as default, when defined.
    type: str

content:
    aliases:
    - value
    - address
    description:
    - Content of the record.
    - Required if C(state=present) or C(multiple=yes).
    type: str

multiple:
    default: false
    description:
    - Whether there are more than one records with similar I(name) and I(record_type).
    - Only allowed for a few record types, e.g. C(record_type=A), C(record_type=NS) or
      C(record_type=MX).
    - I(content) will not be updated, instead it is used as a key to find existing records.
    type: bool

api_region:
    default: cloudstack
    description:
    - Name of the ini section in the C(cloustack.ini) file.
    - Since 2.4, the ENV variable C(CLOUDSTACK_REGION) is used as default, when defined.
    type: str

api_secret:
    description:
    - Secret key of the Exoscale DNS API.
    - Since 2.4, the ENV variable C(CLOUDSTACK_SECRET) is used as default, when defined.
    type: str

api_timeout:
    default: 10
    description:
    - HTTP timeout to Exoscale DNS API.
    - Since 2.4, the ENV variable C(CLOUDSTACK_TIMEOUT) is used as default, when defined.
    type: int

record_type:
    aliases:
    - rtype
    - type
    choices:
    - A
    - ALIAS
    - CNAME
    - MX
    - SPF
    - URL
    - TXT
    - NS
    - SRV
    - NAPTR
    - PTR
    - AAAA
    - SSHFP
    - HINFO
    - POOL
    default: A
    description:
    - Type of the record.
    type: str

validate_certs:
    default: true
    description:
    - Validate SSL certs of the Exoscale DNS API.
    type: bool

Outputs

exo_dns_record:
  contains:
    content:
      description: value of the record
      returned: success
      sample: 1.2.3.4
      type: str
    created_at:
      description: When the record was created
      returned: success
      sample: '2016-08-12T15:24:23.989Z'
      type: str
    domain:
      description: Name of the domain
      returned: success
      sample: example.com
      type: str
    domain_id:
      description: ID of the domain
      returned: success
      sample: 254324
      type: int
    id:
      description: ID of the record
      returned: success
      sample: 254324
      type: int
    name:
      description: name of the record
      returned: success
      sample: www
      type: str
    parent_id:
      description: ID of the parent
      returned: success
      sample: null
      type: int
    prio:
      description: Priority of the record
      returned: success
      sample: 10
      type: int
    record_type:
      description: Priority of the record
      returned: success
      sample: A
      type: str
    system_record:
      description: Whether the record is a system record or not
      returned: success
      sample: false
      type: bool
    ttl:
      description: Time to live of the record
      returned: success
      sample: 3600
      type: int
    updated_at:
      description: When the record was updated
      returned: success
      sample: '2016-08-12T15:24:23.989Z'
      type: str
  description: API record results
  returned: success
  type: complex