mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
The CX Gen 2 and CPX Gen 1 types are deprecated and will be removed from the API at the end of the year. This replaces all usages in our docs, so users do not have to figure it out themselves.
27 lines
674 B
YAML
27 lines
674 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: hel1
|
|
size: 100
|
|
state: present
|
|
register: volume
|
|
|
|
- name: Create a server
|
|
hetzner.hcloud.server:
|
|
name: my-server
|
|
server_type: cpx22
|
|
image: debian-12
|
|
location: fsn1
|
|
volumes:
|
|
- "{{ volume.hcloud_volume.id }}"
|
|
state: present
|