From 782c60a9493f10e77b192235c0939ad8264c7b81 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 6 Jan 2022 22:39:26 +0100 Subject: finalize vm/guest/deploy --- roles/vm/guest/deploy/tasks/main.yml | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'roles/vm/guest/deploy/tasks/main.yml') 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: -- cgit v1.2.3