Closed marcanpilami closed 4 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 @gthiemonge click here for bot help
It fails the same way also when the ApiKey is no more valid
Adding the apikey is deprecated so the module is going to be useless shortly
Module works fine by replacing Apikey with Bearer on gandi_livedns.py line 53 and put your PAT into api_key -parameter. The correct fix could be replacing api_key parameter with pat but then you loose backward compatibility.
53c53
< headers = {'Authorization': 'Apikey {0}'.format(self.api_key),
---
> headers = {'Authorization': 'Bearer {0}'.format(self.api_key),
Making the key type configurable should solve the problem in a backwards-compatible way.
Summary
When I try to create a new DNS entry in an existing domain with the gandi module, it fails silently when using a bearer token instead of an API key only.
Error message is simply (in debug mode:
We should expect the task to work, or to fail with an explicit message.
Issue Type
Bug Report
Component Name
community.general.gandi_livedns
Ansible Version
Community.general Version
Configuration
N/A
OS / Environment
Debian 11, running on localhost for this task.
Steps to Reproduce
See above. Do not forget to use a bearer token and not an API key.
Expected Results
We should expect the task to work, or to fail with an explicit message.
Actual Results
Failure.
It seems that at https://github.com/ansible-collections/community.general/blob/1b9d437be8d085b714f2c38208b30401e7dcf2d9/plugins/module_utils/gandi_livedns_api.py#L53 the module hard codes the type of key. However this type of key is deprecated. Also, no error message is provided in this case.
Code of Conduct