community.general.memset_zone module – Creates and deletes Memset DNS zones.
Note
This module is part of the community.general collection (version 4.8.3).
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.memset_zone
.
Parameters
Parameter |
Comments |
---|---|
The API key obtained from the Memset control panel. |
|
Forces deletion of a zone and all zone domains/zone records it contains. Choices:
|
|
The zone nickname; usually the same as the main domain. Ensure this value has at most 250 characters. |
|
Indicates desired state of resource. Choices:
|
|
The default TTL for all records created in the zone. This must be a valid int from https://www.memset.com/apidocs/methods_dns.html#dns.zone_create. Choices:
|
Notes
Note
Zones can be thought of as a logical group of domains, all of which share the same DNS records (i.e. they point to the same IP). An API key generated via the Memset customer control panel is needed with the following minimum scope - dns.zone_create, dns.zone_delete, dns.zone_list.
Examples
# Create the zone 'test'
- name: Create zone
community.general.memset_zone:
name: test
state: present
api_key: 5eb86c9196ab03919abcf03857163741
ttl: 300
delegate_to: localhost
# Force zone deletion
- name: Force delete zone
community.general.memset_zone:
name: test
state: absent
api_key: 5eb86c9196ab03919abcf03857163741
force: true
delegate_to: localhost
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Zone info from the Memset API Returned: when state == present |
|
List of domains in this zone Returned: always Sample: [] |
|
Zone id Returned: always Sample: “b0bb1ce851aeea6feeb2dc32fe83bf9c” |
|
Zone name Returned: always Sample: “example.com” |
|
List of DNS records for domains in this zone Returned: always Sample: [] |
|
Default TTL for domains in this zone Returned: always Sample: 300 |
Authors
Simon Weald (@glitchcrab)
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication