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:
Jan 2019-01-10 23:54:17 +01:00
parent bbbbce3137
commit 0ca924eca0
3 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,4 @@
---
- name: qm rescan
shell: qm rescan

View 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

View File

@ -5,3 +5,6 @@
roles:
- pve-subscribe
- vmhost
- pve-nginx-redirector
- role: prepare-template-iso
url: "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-9.6.0-amd64-netinst.iso"