fine tuned storage creation and attachment

This commit is contained in:
2024-11-16 18:55:47 +01:00
parent 5a0e645bed
commit c0f1f9051e
6 changed files with 54 additions and 22 deletions

View File

@@ -1,6 +1,6 @@
---
- name: Create server
hcloud_server:
hetzner.hcloud.server:
name: "{{ hostname }}"
server_type: "{{ type }}"
image: "{{ image }}"
@@ -8,12 +8,12 @@
enable_ipv4: false
state: present
ssh_keys: "{{ ssh_keys }}"
# FIXME: https://github.com/ansible-collections/hetzner.hcloud/issues/585
#volumes: "{{ storage.home.name }}"
register: server
# - command: which python
# register: result
# - name: Install Packages
# community.general.pkgng:
# state: present
# name: "{{ packages }}"
- name: Attach the home volume
hetzner.hcloud.volume:
name: "{{ storage.home.name }}"
server: "{{ hostname }}"
state: present