diff --git a/ansible/proxmox/cloudinit_template.yml b/ansible/proxmox/cloudinit_template.yml index 343755f..1c98426 100644 --- a/ansible/proxmox/cloudinit_template.yml +++ b/ansible/proxmox/cloudinit_template.yml @@ -36,7 +36,7 @@ - name: Set candidate information ansible.builtin.set_fact: has_image_file: "{{ image_exists.stat.exists }}" - root_free_space: "{{ (ansible_mounts | selectattr('mount', 'equalto', '/') | first).size_available }}" + root_free_space: "{{ (ansible_facts['mounts'] | selectattr('mount', 'equalto', '/') | first).size_available }}" - name: Select target host ansible.builtin.set_fact: @@ -66,7 +66,9 @@ - name: Destroy existing template if present ansible.builtin.command: qm destroy {{ template_vmid }} --purge - when: template_status.rc == 0 + when: + - template_status.rc == 0 + - image_download.changed - name: Rebuild the template when: