From 1558bd6d0b93c455be55ec3b3e8dec86a7dbe499 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 17 May 2020 20:43:29 +0200 Subject: [PATCH] add option to set global access token --- defaults/main.yml | 2 ++ tasks/setup.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 463a1f3..84a7087 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -11,6 +11,8 @@ hcloud_server: {} # api_token: "{{ hcloud_server_api_token | default(omit) }}" # @end +# @var hcloud_server_default_api_token: $ "_unset_" + hcloud_server_volumes: [] # @var hcloud_server_volumes:example: > # hcloud_server_volumes: diff --git a/tasks/setup.yml b/tasks/setup.yml index 73fc9c4..db27eaa 100644 --- a/tasks/setup.yml +++ b/tasks/setup.yml @@ -6,7 +6,7 @@ ssh_keys: "{{ hcloud_server.ssh_keys | default([]) }}" image: "{{ hcloud_server.image | default('centos-7') }}" location: "{{ hcloud_server.location | default('nbg1') }}" - api_token: "{{ hcloud_server.api_token | default(omit) }}" + api_token: "{{ hcloud_server.api_token | default(hcloud_server_default_api_token | default(omit)) }}" state: present register: __hcloud_server async: 7200