ansible.builtin.nsupdate (v2.4.6.0-1) — module

Manage DNS records.

| "added in version" 2.3 of ansible.builtin"

Authors: Loic Blot (@nerzhul)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.4.6.0.post1

Description

Create, update and remove DNS records using DDNS updates

DDNS works well with both bind and Microsoft DNS (see https://technet.microsoft.com/en-us/library/cc961412.aspx)


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add or modify ansible.example.org A to 192.168.1.1"
  nsupdate:
    key_name: "nsupdate"
    key_secret: "+bFQtBCta7j2vWkjPkAFtgA=="
    server: "10.1.1.1"
    zone: "example.org"
    record: "ansible"
    value: "192.168.1.1"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove puppet.example.org CNAME
  nsupdate:
    key_name: "nsupdate"
    key_secret: "+bFQtBCta7j2vWkjPkAFtgA=="
    server: "10.1.1.1"
    zone: "example.org"
    record: "puppet"
    type: "CNAME"
    state: absent

Inputs

    
ttl:
    default: 3600
    description:
    - Sets the record TTL.

type:
    default: A
    description:
    - Sets the record type.

zone:
    description:
    - DNS record will be modified on this C(zone).
    required: true

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Manage DNS record.

value:
    default: None
    description:
    - Sets the record value.

record:
    description:
    - Sets the DNS record to modify.
    required: true

server:
    description:
    - Apply DNS modification on this server.
    required: true

key_name:
    description:
    - Use TSIG key name to authenticate against DNS C(server)

key_secret:
    description:
    - Use TSIG key secret, associated with C(key_name), to authenticate against C(server)

key_algorithm:
    choices:
    - HMAC-MD5.SIG-ALG.REG.INT
    - hmac-md5
    - hmac-sha1
    - hmac-sha224
    - hmac-sha256
    - hamc-sha384
    - hmac-sha512
    default: hmac-md5
    description:
    - Specify key algorithm used by C(key_secret).

Outputs

changed:
  description: If module has modified record
  returned: success
  type: string
dns_rc:
  description: dnspython return code
  returned: always
  sample: 4
  type: int
dns_rc_str:
  description: dnspython return code (string representation)
  returned: always
  sample: REFUSED
  type: string
record:
  description: DNS record
  returned: success
  sample: ansible
  type: string
ttl:
  description: DNS record TTL
  returned: success
  sample: 86400
  type: int
type:
  description: DNS record type
  returned: success
  sample: CNAME
  type: string
value:
  description: DNS record value
  returned: success
  sample: 192.168.1.1
  type: string
zone:
  description: DNS record zone
  returned: success
  sample: example.org.
  type: string