summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2022-01-05 00:53:41 +0100
committerChristian Pointner <equinox@spreadspace.org>2022-01-05 00:53:41 +0100
commit8427c4bf08ab2d3afa590cef5dcf7087674c2b91 (patch)
tree41d97d37295ce6437850a30bb50db826856d6f8a
parentvm/deploy: improved handling of primary disk (diff)
vm/deploy: create containing dir for primary disk image
-rw-r--r--inventory/host_vars/ch-testvm-openwrt.yml2
-rw-r--r--roles/vm/guest/deploy/tasks/main.yml7
2 files changed, 7 insertions, 2 deletions
diff --git a/inventory/host_vars/ch-testvm-openwrt.yml b/inventory/host_vars/ch-testvm-openwrt.yml
index 5a208b55..d19466ac 100644
--- a/inventory/host_vars/ch-testvm-openwrt.yml
+++ b/inventory/host_vars/ch-testvm-openwrt.yml
@@ -9,7 +9,7 @@ install:
scsi:
sda:
type: image
- path: /srv/nvme/ch-testvm-openwrt.img
+ path: /srv/nvme/ch-testvm-openwrt/root.img
interfaces:
- bridge: br-svc
name: svc0
diff --git a/roles/vm/guest/deploy/tasks/main.yml b/roles/vm/guest/deploy/tasks/main.yml
index 5fb5b56f..f203fdff 100644
--- a/roles/vm/guest/deploy/tasks/main.yml
+++ b/roles/vm/guest/deploy/tasks/main.yml
@@ -6,7 +6,12 @@
get_mime: yes
register: output_image_info
- ## TODO: prepare directory for disk images
+- name: make sure primary disk image path exists
+ delegate_to: "{{ vm_host.name }}"
+ file:
+ path: "{{ vm_deploy_primary_disk.path | dirname }}"
+ state: directory
+
## TODO: actually call this directly and make file replacement atomic!!
## Probably by writing and action plugin based on this: https://github.com/socratesx/Ansible-Decompress
- name: copy disk image