-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wait for ansible 2.10 release on RHEL] Rename cloudflare_account_api_token variable to avoid HTTP 400 errors. #86
Comments
If agreed, I would be happy to create a pull request to update the variable name. |
Cloudflare support is broken, because of this bug. |
Update: The cloudflare module issue has been fixed upstream. Now the module supports both api_token (using In my opinion there are two possible soultions:
|
@rbo can I help with a PR? If yes, which approach would be best? |
Sure, PR always welcome! To be honest I don't know which approach ist the best. I had it to work-a-round if someone brakes an api. The suggested solution, sounds good:
We have to clean up the variables names too :-/ |
The two options exclude each other. If we update the variable name and the documentation to direct users to use the account global key there is no need to change the module since we are going to use the old one. The only issue with this approach is from security point of view. |
A little summery to understand the problem: Cloudflare supports two kinds of API-Tokens:
Ansible module cloudflare_dns supports ONLY 2. global account api key*That means, hetzner-ocp4 also only support the global api key authentication. With PR #62707 the ansible module cloudflare_dns changed the name from * Ansible 2.10 add support for 1. API-Token. Got it, the nameing is not perfect with cloudflare_account_api_token
BUT it's NOT breaking the function of hetzner-ocp4 & together with cloudflare. Of curse you have to use the global account key! We should improve the documentation and if ansible 2.10 is available add the support for API-Token. If someone provide a patch to rename |
Added some notes to documentation. |
Ansible 2.9 on RHEL 8 still not support API-Token:
|
Ansible 2.9 on RHEL 8 still not support API-Token:
|
With the ansible-navigator, we can add supported for cloud-flare api token:
|
First version (not tested yet) at branche issuer-86 |
|
The variable
cloudflare_account_api_token
should be renamed accordingly since the user should provide a global key and not an api token. The current naming leads to possible misunderstanng errors.Steps to reproduce
Obtain an API Token in Cloudflare and assign it to the
cloudflare_account_api_token
.Run the playbook.
Expected error message
The message will appear in the Ansible logs.
Causes
When passing an
In Cloudflare APIs tokens are consumed as bearer token while global keys are consumed as X-Auth-Token.
The ansible module cloudflare_dns despite calling the related parameter account_api_token, sends a request passing an X-Auth-Token header. To match the kind of header the user should provide a global key.
Resolution
To help users to not fall in this issue I suggest to rename our variable cloudflare_account_api_token to cloudflare_account_global_key.
The text was updated successfully, but these errors were encountered: