From 75b6b4d79242646bb15c863d585fcd54958dfb43 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 06:57:33 +0100 Subject: [PATCH] [PR #11461/4bbedfd7 backport][stable-12] nsupdate: fix missing keyring initialization without TSIG auth (#11516) nsupdate: fix missing keyring initialization without TSIG auth (#11461) * nsupdate: fix missing keyring initialization without TSIG auth * Update changelogs/fragments/fix-nsupdate-keyring.yml --------- (cherry picked from commit 4bbedfd7dfd43c61ac40a0eb1364b5ff32e9e321) Co-authored-by: Pascal Co-authored-by: Felix Fontein --- changelogs/fragments/fix-nsupdate-keyring.yml | 2 ++ plugins/modules/nsupdate.py | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 changelogs/fragments/fix-nsupdate-keyring.yml diff --git a/changelogs/fragments/fix-nsupdate-keyring.yml b/changelogs/fragments/fix-nsupdate-keyring.yml new file mode 100644 index 0000000000..05e4403151 --- /dev/null +++ b/changelogs/fragments/fix-nsupdate-keyring.yml @@ -0,0 +1,2 @@ +bugfixes: + - nsupdate - fix ``AttributeError`` when using the module without TSIG authentication (https://github.com/ansible-collections/community.general/issues/11460, https://github.com/ansible-collections/community.general/pull/11461). diff --git a/plugins/modules/nsupdate.py b/plugins/modules/nsupdate.py index dc49e8e77d..76cb131bb3 100644 --- a/plugins/modules/nsupdate.py +++ b/plugins/modules/nsupdate.py @@ -248,6 +248,9 @@ class RecordManager: module.fail_json(msg="Missing key_secret") except binascii_error as e: module.fail_json(msg=f"TSIG key error: {e}") + else: + self.keyring = None + self.keyname = None if module.params["zone"] is None: if module.params["record"][-1] != ".":