feat(proxmox): automatic vm creation
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
12
roles/proxmox/tasks/42_download_isos.yml
Normal file
12
roles/proxmox/tasks/42_download_isos.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: Check if file exists
|
||||
ansible.builtin.stat:
|
||||
path: "{{ proxmox_dirs.isos }}/{{ distro.name }}"
|
||||
register: image_stat
|
||||
|
||||
- name: Download image if missing
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ distro.url }}"
|
||||
dest: "{{ proxmox_dirs.isos }}/{{ distro.name }}"
|
||||
mode: "0644"
|
||||
when: not image_stat.stat.exists
|
||||
Reference in New Issue
Block a user