community.general.gandi_livedns module – Manage Gandi LiveDNS records

Note

This module is part of the community.general collection (version 9.5.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.gandi_livedns.

New in community.general 2.3.0

Synopsis

Parameters

Parameter

Comments

api_key

string

Account API token.

Note that these type of keys are deprecated and might stop working at some point. Use personal access tokens instead.

One of personal_access_token and api_key must be specified.

domain

string / required

The name of the Domain to work with (for example, “example.com”).

personal_access_token

string

added in community.general 9.0.0

Scoped API token.

One of personal_access_token and api_key must be specified.

record

string / required

Record to add.

state

string

Whether the record(s) should exist or not.

Choices:

  • "absent"

  • "present" ← (default)

ttl

integer

The TTL to give the new record.

Required when state=present.

type

string / required

The type of DNS record to create.

values

list / elements=string

The record values.

Required when state=present.

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Examples

- 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
    personal_access_token: dummytoken
  register: record

- 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
    personal_access_token: dummytoken
    state: present

- name: Change its TTL
  community.general.gandi_livedns:
    domain: my.com
    type: CNAME
    record: mail
    values:
    - www
    ttl: 10800
    personal_access_token: dummytoken
    state: present

- name: Delete the record
  community.general.gandi_livedns:
    domain: my.com
    type: CNAME
    record: mail
    personal_access_token: dummytoken
    state: absent

- name: Use a (deprecated) API Key
  community.general.gandi_livedns:
    domain: my.com
    record: test
    type: A
    values:
    - 127.0.0.1
    ttl: 7200
    api_key: dummyapikey

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

record

dictionary

A dictionary containing the record data.

Returned: success, except on record deletion

domain

string

The domain associated with the record.

Returned: success

Sample: "my.com"

record

string

The record name.

Returned: success

Sample: "www"

ttl

integer

The time-to-live for the record.

Returned: success

Sample: 300

type

string

The record type.

Returned: success

Sample: "A"

values

list / elements=string

The record content (details depend on record type).

Returned: success

Sample: ["192.0.2.91", "192.0.2.92"]

Authors

  • Gregory Thiemonge (@gthiemonge)