community.general.netcup_dns (8.5.0) — module

Manage Netcup DNS records

Authors: Nicolai Buchwitz (@nbuchwitz)

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 via the Netcup API, see the docs U(https://ccp.netcup.net/run/webservice/servers/endpoint.php).


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Increase the connection timeout to avoid problems with an unstable connection
  community.general.netcup_dns:
    api_key: "..."
    api_password: "..."
    customer_id: "..."
    domain: "example.com"
    name: "mail"
    type: "A"
    value: "127.0.0.1"
    timeout: 30

Inputs

    
solo:
    default: false
    description:
    - Whether the record should be the only one for that record type and record name.
      Only use with O(state=present).
    - This will delete all other records with the same record name and type.
    type: bool

type:
    choices:
    - A
    - AAAA
    - MX
    - CNAME
    - CAA
    - SRV
    - TXT
    - TLSA
    - NS
    - DS
    - OPENPGPKEY
    - SMIMEA
    - SSHFP
    description:
    - Record type.
    - Support for V(OPENPGPKEY), V(SMIMEA) and V(SSHFP) was added in community.general
      8.1.0.
    - Record types V(OPENPGPKEY) and V(SMIMEA) require nc-dnsapi >= 0.1.5.
    - Record type V(SSHFP) requires nc-dnsapi >= 0.1.6.
    required: true
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Whether the record should exist or not.
    required: false
    type: str

value:
    description:
    - Record value.
    required: true
    type: str

domain:
    description:
    - Domainname the records should be added / removed.
    required: true
    type: str

record:
    aliases:
    - name
    default: '@'
    description:
    - Record to add or delete, supports wildcard (V(*)). Default is V(@) (that is, the
      zone name).
    type: str

api_key:
    description:
    - API key for authentication, must be obtained via the netcup CCP (U(https://ccp.netcup.net)).
    required: true
    type: str

timeout:
    default: 5
    description:
    - HTTP(S) connection timeout in seconds.
    type: int
    version_added: 5.7.0
    version_added_collection: community.general

priority:
    description:
    - Record priority. Required for O(type=MX).
    required: false
    type: int

customer_id:
    description:
    - Netcup customer id.
    required: true
    type: int

api_password:
    description:
    - API password for authentication, must be obtained via the netcup CCP (U(https://ccp.netcup.net)).
    required: true
    type: str

Outputs

records:
  contains:
    id:
      description: internal id of the record
      returned: success
      sample: 12345
      type: int
    name:
      description: the record name
      returned: success
      sample: fancy-hostname
      type: str
    priority:
      description: the record priority (only relevant if type=MX)
      returned: success
      sample: 0
      type: int
    type:
      description: the record type
      returned: success
      sample: A
      type: str
    value:
      description: the record destination
      returned: success
      sample: 127.0.0.1
      type: str
  description: list containing all records
  returned: success
  type: complex