community / community.general / 3.8.10 / module / nsupdate Manage DNS records. Authors: Loic Blot (@nerzhul)community.general.nsupdate (3.8.10) — module
Install with ansible-galaxy collection install community.general:==3.8.10
collections: - name: community.general version: 3.8.10
Create, update and remove DNS records using DDNS updates
- name: Add or modify ansible.example.org A to 192.168.1.1" community.general.nsupdate: key_name: "nsupdate" key_secret: "+bFQtBCta7j2vWkjPkAFtgA==" server: "10.1.1.1" zone: "example.org" record: "ansible" value: "192.168.1.1"
- name: Add or modify ansible.example.org A to 192.168.1.1, 192.168.1.2 and 192.168.1.3" community.general.nsupdate: key_name: "nsupdate" key_secret: "+bFQtBCta7j2vWkjPkAFtgA==" server: "10.1.1.1" zone: "example.org" record: "ansible" value: ["192.168.1.1", "192.168.1.2", "192.168.1.3"]
- name: Remove puppet.example.org CNAME community.general.nsupdate: key_name: "nsupdate" key_secret: "+bFQtBCta7j2vWkjPkAFtgA==" server: "10.1.1.1" zone: "example.org" record: "puppet" type: "CNAME" state: absent
- name: Add 1.1.168.192.in-addr.arpa. PTR for ansible.example.org community.general.nsupdate: key_name: "nsupdate" key_secret: "+bFQtBCta7j2vWkjPkAFtgA==" server: "10.1.1.1" record: "1.1.168.192.in-addr.arpa." type: "PTR" value: "ansible.example.org." state: present
- name: Remove 1.1.168.192.in-addr.arpa. PTR community.general.nsupdate: key_name: "nsupdate" key_secret: "+bFQtBCta7j2vWkjPkAFtgA==" server: "10.1.1.1" record: "1.1.168.192.in-addr.arpa." type: "PTR" state: absent
ttl: default: 3600 description: - Sets the record TTL. type: int port: default: 53 description: - Use this TCP port when connecting to C(server). type: int type: default: A description: - Sets the record type. type: str zone: description: - DNS record will be modified on this C(zone). - When omitted DNS will be queried to attempt finding the correct zone. - Starting with Ansible 2.7 this parameter is optional. type: str state: choices: - present - absent default: present description: - Manage DNS record. type: str value: description: - Sets the record value. elements: str type: list record: description: - Sets the DNS record to modify. When zone is omitted this has to be absolute (ending with a dot). required: true type: str server: description: - Apply DNS modification on this server, specified by IPv4 or IPv6 address. required: true type: str key_name: description: - Use TSIG key name to authenticate against DNS C(server) type: str protocol: choices: - tcp - udp default: tcp description: - Sets the transport protocol (TCP or UDP). TCP is the recommended and a more robust option. type: str key_secret: description: - Use TSIG key secret, associated with C(key_name), to authenticate against C(server) type: str key_algorithm: choices: - HMAC-MD5.SIG-ALG.REG.INT - hmac-md5 - hmac-sha1 - hmac-sha224 - hmac-sha256 - hmac-sha384 - hmac-sha512 default: hmac-md5 description: - Specify key algorithm used by C(key_secret). type: str
changed: description: If module has modified record returned: success type: str 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: str record: description: DNS record returned: success sample: ansible type: str ttl: description: DNS record TTL returned: success sample: 86400 type: int type: description: DNS record type returned: success sample: CNAME type: str value: description: DNS record value(s) returned: success sample: 192.168.1.1 type: list zone: description: DNS record zone returned: success sample: example.org. type: str