summaryrefslogtreecommitdiff
path: root/roles/vm/guest/deploy/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/vm/guest/deploy/tasks/main.yml')
-rw-r--r--roles/vm/guest/deploy/tasks/main.yml22
1 files changed, 5 insertions, 17 deletions
diff --git a/roles/vm/guest/deploy/tasks/main.yml b/roles/vm/guest/deploy/tasks/main.yml
index aa27b59d..1b4a4e63 100644
--- a/roles/vm/guest/deploy/tasks/main.yml
+++ b/roles/vm/guest/deploy/tasks/main.yml
@@ -1,11 +1,4 @@
---
-- name: fetch infos from image file
- delegate_to: localhost
- stat:
- path: "{{ output_images | first }}"
- get_mime: yes
- register: output_image_info
-
- name: make sure primary disk image path exists
delegate_to: "{{ vm_host.name }}"
file:
@@ -16,16 +9,11 @@
import_role:
name: vm/guest/remove
- ## 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
- pause:
- prompt: |
- Please copy the image to the vm-host i.e. by calling this:
-
- cat {{ output_image_info.stat.path }} | {{ vm_deploy_decompressors[output_image_info.stat.mimetype] }} | ssh {{ vm_host.name }} 'cat > {{ vm_deploy_primary_disk.path }}'
-
- When done press ENTER to continue or CTRL-C then A to abort.
+- name: deploy disk image
+ delegate_to: "{{ vm_host.name }}"
+ replace_vm_image:
+ src: "{{ output_images | first }}"
+ dest: "{{ vm_deploy_primary_disk.path }}"
- name: create vm
vars: