community.general.netcup_dns module – manage Netcup DNS records
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.netcup_dns
.
Synopsis
Manages DNS records via the Netcup API, see the docs https://ccp.netcup.net/run/webservice/servers/endpoint.php
Requirements
The below requirements are needed on the host that executes this module.
nc-dnsapi >= 0.1.3
Parameters
Parameter |
Comments |
---|---|
API key for authentication, must be obtained via the netcup CCP (https://ccp.netcup.net) |
|
API password for authentication, must be obtained via the netcup CCP (https://ccp.netcup.net) |
|
Netcup customer id |
|
Domainname the records should be added / removed |
|
Record priority. Required for |
|
Record to add or delete, supports wildcard (*). Default is Default: “@” |
|
Whether the record should be the only one for that record type and record name. Only use with This will delete all other records with the same record name and type. Choices:
|
|
Whether the record should exist or not Choices:
|
|
Record type Choices:
|
|
Record value |
Examples
- name: Create a record of type A
community.general.netcup_dns:
api_key: "..."
api_password: "..."
customer_id: "..."
domain: "example.com"
name: "mail"
type: "A"
value: "127.0.0.1"
- name: Delete that record
community.general.netcup_dns:
api_key: "..."
api_password: "..."
customer_id: "..."
domain: "example.com"
name: "mail"
type: "A"
value: "127.0.0.1"
state: absent
- name: Create a wildcard record
community.general.netcup_dns:
api_key: "..."
api_password: "..."
customer_id: "..."
domain: "example.com"
name: "*"
type: "A"
value: "127.0.1.1"
- name: Set the MX record for example.com
community.general.netcup_dns:
api_key: "..."
api_password: "..."
customer_id: "..."
domain: "example.com"
type: "MX"
value: "mail.example.com"
- name: Set a record and ensure that this is the only one
community.general.netcup_dns:
api_key: "..."
api_password: "..."
customer_id: "..."
name: "demo"
domain: "example.com"
type: "AAAA"
value: "::1"
solo: true
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
list containing all records Returned: success |
|
internal id of the record Returned: success Sample: 12345 |
|
the record name Returned: success Sample: “fancy-hostname” |
|
the record priority (only relevant if type=MX) Returned: success Sample: 0 |
|
the record type Returned: succcess Sample: “A” |
|
the record destination Returned: success Sample: “127.0.0.1” |
Authors
Nicolai Buchwitz (@nbuchwitz)
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication