1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00

expand template instructions in 'token' property

fixes #48
This commit is contained in:
Tobias Fischer 2021-01-28 14:34:27 +01:00 committed by Tobias Fischer
parent 9eb083728a
commit 146fce3b95
No known key found for this signature in database
GPG key ID: CED0180FDDEBD107

View file

@ -112,7 +112,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
def _configure_hcloud_client(self):
self.token_env = self.get_option("token_env")
self.api_token = self.get_option("token") or os.getenv(self.token_env)
self.api_token = self.templar.template(self.get_option("token"), fail_on_undefined=False) or os.getenv(self.token_env)
if self.api_token is None:
raise AnsibleError(
"Please specify a token, via the option token, via environment variable HCLOUD_TOKEN "