community.general.gandi_livedns (8.5.0) — module

Manage Gandi LiveDNS records

| "added in version" 2.3.0 of community.general"

Authors: Gregory Thiemonge (@gthiemonge)

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 DNS records by the Gandi LiveDNS API, see the docs: U(https://doc.livedns.gandi.net/).

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a test A record to point to 127.0.0.1 in the my.com domain
  community.general.gandi_livedns:
    domain: my.com
    record: test
    type: A
    values:
    - 127.0.0.1
    ttl: 7200
    api_key: dummyapitoken
  register: record
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a mail CNAME record to www.my.com domain
  community.general.gandi_livedns:
    domain: my.com
    type: CNAME
    record: mail
    values:
    - www
    ttl: 7200
    api_key: dummyapitoken
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Change its TTL
  community.general.gandi_livedns:
    domain: my.com
    type: CNAME
    record: mail
    values:
    - www
    ttl: 10800
    api_key: dummyapitoken
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete the record
  community.general.gandi_livedns:
    domain: my.com
    type: CNAME
    record: mail
    api_key: dummyapitoken
    state: absent

Inputs

    
ttl:
    description:
    - The TTL to give the new record.
    - Required when O(state=present).
    type: int

type:
    description:
    - The type of DNS record to create.
    required: true
    type: str

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Whether the record(s) should exist or not.
    type: str

domain:
    description:
    - The name of the Domain to work with (for example, "example.com").
    required: true
    type: str

record:
    description:
    - Record to add.
    required: true
    type: str

values:
    description:
    - The record values.
    - Required when O(state=present).
    elements: str
    type: list

api_key:
    description:
    - Account API token.
    required: true
    type: str

Outputs

record:
  contains:
    domain:
      description: The domain associated with the record.
      returned: success
      sample: my.com
      type: str
    record:
      description: The record name.
      returned: success
      sample: www
      type: str
    ttl:
      description: The time-to-live for the record.
      returned: success
      sample: 300
      type: int
    type:
      description: The record type.
      returned: success
      sample: A
      type: str
    values:
      description: The record content (details depend on record type).
      elements: str
      returned: success
      sample:
      - 192.0.2.91
      - 192.0.2.92
      type: list
  description: A dictionary containing the record data.
  returned: success, except on record deletion
  type: dict