diff --git a/tasks/create_proxmox_debian_template.yml b/tasks/create_proxmox_debian_template.yml index 67aad8f..833a204 100644 --- a/tasks/create_proxmox_debian_template.yml +++ b/tasks/create_proxmox_debian_template.yml @@ -250,13 +250,18 @@ tasks: - block: - - name: Mount the LXC container filesystem - command: "pct mount {{ lxc_id }}" + - name: Copy file from LXC container to host using pct exec + command: pct exec "{{ lxc_id }}" -- cp {{ workdir }}/{{ template_name }}.qcow2 /var/lib/vz/template/qemu/ - - name: Copy file from LXC container to the host - copy: - src: "/var/lib/lxc/{{ lxc_id }}/rootfs/{{ workdir }}/{{ template_name }}.qcow2" - dest: "/var/lib/vz/template/qemu/" + - name: Copy file from LXC container to host using rsync + command: pct exec "{{ lxc_id }}" -- rsync -av {{ workdir }}/{{ template_name }}.qcow2 /var/lib/vz/template/qemu/ + # - name: Mount the LXC container filesystem + # command: "pct mount {{ lxc_id }}" + + # - name: Copy file from LXC container to the host + # copy: + # src: "/var/lib/lxc/{{ lxc_id }}/rootfs/{{ workdir }}/{{ template_name }}.qcow2" + # dest: "/var/lib/vz/template/qemu/" - name: Unmount the LXC container filesystem command: "pct unmount {{ lxc_id }}"