diff --git a/tasks/create_proxmox_debian_template.yml b/tasks/create_proxmox_debian_template.yml index cf1de59..018559a 100644 --- a/tasks/create_proxmox_debian_template.yml +++ b/tasks/create_proxmox_debian_template.yml @@ -225,14 +225,21 @@ # qemu-img convert -O qcow2 -c {{ workdir }}/{{ image_name }} {{ workdir }}/{{ template_name }}.qcow2 # qemu-img resize {{ workdir }}/{{ template_name }}.qcow2 --shrink - - name: Copy finished template back to Proxmox host - ansible.posix.synchronize: - src: "{{ workdir }}/{{ template_name }}.qcow2" - dest: "/var/lib/vz/template/qemu/" - mode: push - # delegate_to: node0 - # rsync_opts: - # - "--rsync-path='sudo rsync'" + # - name: Copy finished template back to Proxmox host + # ansible.posix.synchronize: + # src: "{{ workdir }}/{{ template_name }}.qcow2" + # dest: "/var/lib/vz/template/qemu/" + # mode: push + # # delegate_to: node0 + # # rsync_opts: + # # - "--rsync-path='sudo rsync'" + + - name: Copy file from LXC container to Proxmox host using rsync + ansible.builtin.command: > + rsync -a --rsh='lxc-attach -n {{ lxc_id }} --' {{ workdir }}/{{ template_name }}.qcow2 /var/lib/vz/template/qemu/ + delegate_to: node0 + args: + warn: false - name: Import Debian Cloud image as Proxmox VM template hosts: node0