ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
816 stars 1.5k forks source link

Can't delete CAA records in Cloudflare #7766

Open domingo13 opened 9 months ago

domingo13 commented 9 months ago

Summary

It is not possible to delete CAA records hosted in Cloudflare with "community.general.cloudflare_dns".

I can create the CAA record just fine but when I change state from present to absent no changes are made. This can be replicated across zones.

Issue Type

Bug Report

Component Name

cloudflare_dns

Ansible Version

ansible --version
ansible [core 2.15.8]
  config file = /root/ansible-project/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True

Community.general Version

ansible-galaxy collection list community.general

# /root/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 8.0.2  

# /usr/lib/python3/dist-packages/ansible_collections
Collection        Version
----------------- -------
community.general 7.5.2 

Configuration

ansible-config dump --only-changed
CONFIG_FILE() = /root/ansible-project/ansible.cfg

OS / Environment

Ubuntu 22.04

Steps to Reproduce

   - name: Ensure CAA record 'f5xc.cloud' exists
    community.general.cloudflare_dns:
      zone: 'f5xc.cloud'
      record: 'f5xc.cloud'
      type: 'CAA'
      flag: 0
      tag: issue
      value: "letsencrypt.org"
      state: present
      ttl: 1
      api_token: "{{ cloudflare_api_token }}"

Deleting:

   - name: Delete CAA record 'f5xc.cloud' 
    community.general.cloudflare_dns:
      zone: 'f5xc.cloud'
      record: 'f5xc.cloud'
      type: 'CAA'
      flag: 0
      tag: issue
      value: "letsencrypt.org"
      state: absent
      ttl: 1
      api_token: "{{ cloudflare_api_token }}"

Expected Results

I expect the record to be deleted in Cloudflare.

Actual Results

Code of Conduct

ansibullbot commented 9 months ago

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 9 months ago

cc @mgruener click here for bot help

felixfontein commented 9 months ago

CAA support has been added in #7399 by @H4ckd4ddy, maybe they have an idea what's happening here.