From a393f4e8628fe7dfec5c23d004ddd9fb63871cf7 Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Wed, 7 Apr 2021 08:17:03 +0200 Subject: [PATCH] expand template instructions in 'token' property (#49) fixes #48 --- plugins/inventory/hcloud.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/inventory/hcloud.py b/plugins/inventory/hcloud.py index c0a3b90..8371bdf 100644 --- a/plugins/inventory/hcloud.py +++ b/plugins/inventory/hcloud.py @@ -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 "