add global defaults
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2020-10-10 13:00:22 +02:00
parent 9c63575852
commit baa6d0513d
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
2 changed files with 17 additions and 8 deletions

View File

@ -4,14 +4,21 @@ hcloud_server: {}
# hcloud_server:
# name: my-server
# type: cx11
# ssh_keys: []
# image:
# location: "{{ hcloud_server_location }}"
# datacenter: "{{ hcloud_server_datacenter }}"
# api_token: "{{ hcloud_server_api_token | default(omit) }}"
# ssh_keys: "{{ hcloud_server_default_ssh_keys }}"
# image: "{{ hcloud_server_default_image }}"
# location: "{{ hcloud_server_default_location }}"
# backup: "{{ hcloud_server_default_backup }}"
# protection: "{{ hcloud_server_default_protection }}"
# api_token: "{{ hcloud_server_default_api_token }}"
# labels:
# os: redhat
# @end
hcloud_server_default_image: centos-7
hcloud_server_default_location: nbg1
hcloud_server_default_protection: False
hcloud_server_default_backup: False
hcloud_server_default_ssh_keys: []
# @var hcloud_server_default_api_token: $ "_unset_"

View File

@ -3,10 +3,12 @@
hcloud_server:
name: "{{ hcloud_server.name }}"
server_type: "{{ hcloud_server.type | default('cx11') }}"
ssh_keys: "{{ hcloud_server.ssh_keys | default([]) }}"
ssh_keys: "{{ hcloud_server.ssh_keys | default(hcloud_server_default_ssh_keys) }}"
image: "{{ hcloud_server.image | default(hcloud_server_default_image) }}"
location: "{{ hcloud_server.location | default('nbg1') }}"
backups: "{{ hcloud_server.backups | default('no') }}"
location: "{{ hcloud_server.location | default(hcloud_server_default_location) }}"
backups: "{{ hcloud_server.backups | default(hcloud_server_default_backup) }}"
delete_protection: "{{ hcloud_server.protection | default(hcloud_server_default_protection) }}"
rebuild_protection: "{{ hcloud_server.protection | default(hcloud_server_default_protection) }}"
labels: "{{ hcloud_server.labels | default({}) }}"
api_token: "{{ hcloud_server.api_token | default(hcloud_server_default_api_token | default(omit)) }}"
state: present