Open aquarion opened 5 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.
cc @mgruener click here for bot help
I just ran into this issue as well and was about the create an issue, so can confirm. First time it works fine, when trying to update it gives an error.
Just to add; when solo
is set to true
, there is no error it will overwrite each existing record.
Setting solo
to true
doesn't work for MX records when there's multiple records with same name but different priorities just like the Google example @aquarion mentioned.
Can also confirm issue is also in newest version of community.general
# /root/.ansible/collections/ansible_collections
Collection Version
----------------- -------
community.general 9.0.0
# /usr/local/lib/python3.10/dist-packages/ansible_collections
Collection Version
----------------- -------
community.general 5.8.3
When I got this, I had used account_api_key
instead of api_token
to specify my API token. Changing the variable to api_token
fixed the issue.
A generic 400 made me think it wasn't an authentication failure, rather something wrong in my request. Perhaps this is a case of the "bad request" response taking precedence over the "authentication failure" response.
I'm unsure if CloudFlare responded with any messages that could have hinted that the authentication details were provided incorrectly, as I cannot see the raw HTTP responses. Perhaps it would be a good idea for this, and similar, roles to print the raw HTTP request/response when under the highest level of verbosity.
Summary
When attempting an MX update with cloudflare dns, I get "400 Bad Request"
Issue Type
Bug Report
Component Name
cloudflare_dns
Ansible Version
Community.general Version
Configuration
OS / Environment
Ubuntu 22.04
Steps to Reproduce
The first task works, the second does not.
Expected Results
The playbook task should execute successfully
Actual Results
I have made a minor change to cloudflare_dns.py to output the data & headers in the failure output, running the same API call with curl is unsuccessfuly successful, thus:
Code of Conduct