You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As announced on 2025-01-27 here, the entries returned by https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records no longer include the zone_id parameter.
Records returned by the API will no longer contain the zone_id and zone_name fields. This change may take up to four weeks to fully roll out. The affected fields were deprecated with an End of Life (EOL) date of November 30, 2024.
However, the parameter is used in the delete_dns_records action of cloudflare_dns:
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'zone_id'failed: [localhost] (item=xxx) => {"ansible_loop_var": "item", "changed": false, "item": "xxx", "module_stderr": "Traceback (most recent call last):\n File \"/opt/app/.ansible/tmp/ansible-tmp-1738249809.769321-1864504-247335003966029/AnsiballZ_cloudflare_dns.py\", line 107, in <module>\n _ansiballz_main()\n File \"/opt/app/.ansible/tmp/ansible-tmp-1738249809.769321-1864504-247335003966029/AnsiballZ_cloudflare_dns.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/opt/app/.ansible/tmp/ansible-tmp-1738249809.769321-1864504-247335003966029/AnsiballZ_cloudflare_dns.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.community.general.plugins.modules.cloudflare_dns', init_globals=dict(_module_fqn='ansible_collections.community.general.plugins.modules.cloudflare_dns', _modlib_path=modlib_path),\n File \"<frozen runpy>\", line 226, in run_module\n File \"<frozen runpy>\", line 98, in _ru n_module_code\n File \"<frozen runpy>\", line 88, in _run_code\n File \"/tmp/ansible_community.general.cloudflare_dns_payload_1i4wdn7s/ansible_community.general.cloudflare_dns_payload.zip/ansible_collections/community/general/plugins/modules/cloudflare_dns.py\", line 949, in <module>\n File \"/tmp/ansible_community.general.cloudflare_dns_payload_1i4wdn7s/ansible_community.general.cloudflare_dns_payload.zip/ansible_collections/community/general/plugins/modules/cloudflare_dns.py\", line 944, in main\n File \"/tmp/ansible_community.general.cloudflare_dns_payload_1i4wdn7s/ansible_community.general.cloudflare_dns_payload.zip/ansible_collections/community/general/plugins/modules/cloudflare_dns.py\", line 659, in delete_dns_records\nKeyError: 'zone_id'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
Code of Conduct
I agree to follow the Ansible Code of Conduct
The text was updated successfully, but these errors were encountered:
Summary
As announced on 2025-01-27 here, the entries returned by
https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records
no longer include thezone_id
parameter.However, the parameter is used in the
delete_dns_records
action ofcloudflare_dns
:community.general/plugins/modules/cloudflare_dns.py
Lines 690 to 699 in 37a9413
This results in
line 659, in delete_dns_records; KeyError: 'zone_id'
(line differs because of older version)Issue Type
Bug Report
Component Name
cloudflare_dns
Ansible Version
Community.general Version
Configuration
$ ansible-config dump --only-changed
OS / Environment
Debian
Steps to Reproduce
Expected Results
Action should not fail
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: