mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
feat: rename api_endpoint module argument (#395)
##### SUMMARY Make the api endpoint module argument consistent with the api token. - Renamed the `endpoint` module argument to `api_endpoint`, backward compatibility is maintained using an alias. - Allow to configure it using the `HCLOUD_ENDPOINT` env var. This makes the inventory config and the modules config a bit more consistent. ##### ISSUE TYPE - Feature Pull Request
This commit is contained in:
parent
9e0bf59231
commit
7c9fbf85a7
4 changed files with 26 additions and 17 deletions
|
|
@ -86,7 +86,7 @@ class AnsibleHCloud:
|
|||
def _build_client(self) -> None:
|
||||
self.client = Client(
|
||||
token=self.module.params["api_token"],
|
||||
api_endpoint=self.module.params["endpoint"],
|
||||
api_endpoint=self.module.params["api_endpoint"],
|
||||
application_name="ansible-module",
|
||||
application_version=version,
|
||||
)
|
||||
|
|
@ -124,9 +124,11 @@ class AnsibleHCloud:
|
|||
"fallback": (env_fallback, ["HCLOUD_TOKEN"]),
|
||||
"no_log": True,
|
||||
},
|
||||
"endpoint": {
|
||||
"api_endpoint": {
|
||||
"type": "str",
|
||||
"fallback": (env_fallback, ["HCLOUD_ENDPOINT"]),
|
||||
"default": "https://api.hetzner.cloud/v1",
|
||||
"aliases": ["endpoint"],
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue