From 76bd1d63fc32768f994ab02c862db9cb955bccf0 Mon Sep 17 00:00:00 2001 From: sjat Date: Sun, 14 Jun 2026 10:57:23 +0200 Subject: [PATCH] fix(public_dns): index loop keys with item['key'] not item.key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit item.values resolved to the dict's built-in .values() METHOD, not the 'values' key, so gandi_livedns received '' as the TXT value — garbage AND non-idempotent (the address changes each run). Bracket-index all loop fields. Caught only by the live apply (apply=false Molecule + data-only pytest both missed it). Co-Authored-By: Claude Opus 4.8 (1M context) --- roles/public_dns/tasks/main.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/roles/public_dns/tasks/main.yml b/roles/public_dns/tasks/main.yml index 521a4b1..f465e9d 100644 --- a/roles/public_dns/tasks/main.yml +++ b/roles/public_dns/tasks/main.yml @@ -13,27 +13,27 @@ - name: Ensure desired records are present (Gandi LiveDNS) community.general.gandi_livedns: domain: "{{ public_dns__domain }}" - record: "{{ item.record }}" - type: "{{ item.type }}" - values: "{{ item.values }}" - ttl: "{{ item.ttl | default(public_dns__default_ttl) }}" + record: "{{ item['record'] }}" + type: "{{ item['type'] }}" + values: "{{ item['values'] }}" + ttl: "{{ item['ttl'] | default(public_dns__default_ttl) }}" state: present personal_access_token: "{{ vault.gandi.pat }}" loop: "{{ public_dns__records }}" loop_control: - label: "{{ item.record }} {{ item.type }}" + label: "{{ item['record'] }} {{ item['type'] }}" run_once: true when: public_dns__apply | bool - name: Ensure unwanted records are absent (Gandi LiveDNS) community.general.gandi_livedns: domain: "{{ public_dns__domain }}" - record: "{{ item.record }}" - type: "{{ item.type }}" + record: "{{ item['record'] }}" + type: "{{ item['type'] }}" state: absent personal_access_token: "{{ vault.gandi.pat }}" loop: "{{ public_dns__absent }}" loop_control: - label: "{{ item.record }} {{ item.type }}" + label: "{{ item['record'] }} {{ item['type'] }}" run_once: true when: public_dns__apply | bool