New role allows to pull iso images
Pull iso files into Proxmox's template/iso/ directory - role: prepare-template-iso url: "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-9.6.0-amd64-netinst.iso"
This commit is contained in:
parent
bbbbce3137
commit
0ca924eca0
4
roles/prepare-template-iso/handlers/main.yml
Normal file
4
roles/prepare-template-iso/handlers/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: qm rescan
|
||||||
|
shell: qm rescan
|
19
roles/prepare-template-iso/tasks/main.yml
Normal file
19
roles/prepare-template-iso/tasks/main.yml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
# tasks:
|
||||||
|
# - name: Fetch basic distro iso templates
|
||||||
|
# include_role: name=prepare-template-iso
|
||||||
|
# vars:
|
||||||
|
# url: "{{ item }}"
|
||||||
|
# with_items:
|
||||||
|
# - "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-9.6.0-amd64-netinst.iso"
|
||||||
|
# - "ftp://ftp.rrzn.uni-hannover.de/pub/mirror/linux/ubuntu-releases/18.04.1.0/ubuntu-18.04.1.0-live-server-amd64.iso"
|
||||||
|
|
||||||
|
- name: "{{ url | basename }} file exists"
|
||||||
|
stat: path=/var/lib/vz/template/iso/{{ url | basename }}
|
||||||
|
register: template_iso
|
||||||
|
|
||||||
|
- name: "download {{ url | basename }}"
|
||||||
|
get_url: url={{ url }} dest=/var/lib/vz/template/iso/{{ url | basename }}
|
||||||
|
when: template_iso.stat.exists == False
|
||||||
|
notify: qm rescan
|
||||||
|
|
Loading…
Reference in New Issue
Block a user