mirror of
https://github.com/ansible-collections/hetzner.hcloud
synced 2024-11-10 06:34:13 +00:00
6581ed50db
##### SUMMARY This allows to use `module_defaults` against all the modules at once using the new `hetzner.hcloud.all` `action_group`. You can now pass the `api_token` argument using module_defaults: ```yaml - name: Demonstrate the usage of the 'hetzner.hcloud.all' module_defaults group hosts: localhost connection: local module_defaults: group/hetzner.hcloud.all: api_token: "{{ _vault_hcloud_api_token }}" tasks: - name: Create a volume hetzner.hcloud.volume: name: my-volume location: fsn1 size: 100 state: present register: volume ``` See the documentation and examples for more details. ##### ISSUE TYPE - Feature Pull Request
27 lines
673 B
YAML
27 lines
673 B
YAML
---
|
|
- name: Demonstrate the usage of the 'hetzner.hcloud.all' module_defaults group
|
|
hosts: localhost
|
|
connection: local
|
|
|
|
module_defaults:
|
|
group/hetzner.hcloud.all:
|
|
api_token: LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj
|
|
|
|
tasks:
|
|
- name: Create a volume
|
|
hetzner.hcloud.volume:
|
|
name: my-volume
|
|
location: fsn1
|
|
size: 100
|
|
state: present
|
|
register: volume
|
|
|
|
- name: Create a server
|
|
hetzner.hcloud.server:
|
|
name: my-server
|
|
server_type: cx11
|
|
image: debian-12
|
|
location: fsn1
|
|
volumes:
|
|
- "{{ volume.hcloud_volume.id }}"
|
|
state: present
|