diff options
-rw-r--r-- | inventory/host_vars/ch-testvm-openwrt.yml | 2 | ||||
-rw-r--r-- | roles/vm/guest/deploy/tasks/main.yml | 7 |
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 |