.
This commit is contained in:
parent
6edffbc0fd
commit
b9f68281af
@ -17,6 +17,8 @@ tlu-harvester:
|
|||||||
url: https://download.opensuse.org/distribution/leap/15.3/appliances/openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.qcow2
|
url: https://download.opensuse.org/distribution/leap/15.3/appliances/openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.qcow2
|
||||||
checksum: da11e3ed78cdadb0c8a15e9dd82c3c2b2746ba61cb98c3c03cfb156e5b8adb10
|
checksum: da11e3ed78cdadb0c8a15e9dd82c3c2b2746ba61cb98c3c03cfb156e5b8adb10
|
||||||
ns: default
|
ns: default
|
||||||
|
- name: MicroOS
|
||||||
|
url: https://download.opensuse.org/tumbleweed/appliances/openSUSE-MicroOS.x86_64-kvm-and-xen.qcow2
|
||||||
ubuntu:
|
ubuntu:
|
||||||
- name: ubuntu 20.04 (Focal Fossa)
|
- name: ubuntu 20.04 (Focal Fossa)
|
||||||
url: https://cloud-images.ubuntu.com/focal/20211015/focal-server-cloudimg-amd64-disk-kvm.img
|
url: https://cloud-images.ubuntu.com/focal/20211015/focal-server-cloudimg-amd64-disk-kvm.img
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
{% for dist, items in pillar['tlu-harvester']['images'].items() -%}
|
{% for dist, items in pillar['tlu-harvester']['images'].items() -%}
|
||||||
{% for item in items -%}
|
{% for item in items -%}
|
||||||
|
{% set name = item['checksum'][-10:] if 'checksum' in item else salt['random.hash'](item['url'], 'md5')[-10:] -%}
|
||||||
|
{% set displayName = item['name'] if 'name' in item else item['url'].split('/')[-1] -%}
|
||||||
|
{% set ns = item['ns'] if 'ns' in item else 'default' -%}
|
||||||
---
|
---
|
||||||
apiVersion: harvesterhci.io/v1beta1
|
apiVersion: harvesterhci.io/v1beta1
|
||||||
kind: VirtualMachineImage
|
kind: VirtualMachineImage
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ item['checksum'][-10:] }}
|
name: {{ name }}
|
||||||
namespace: {{ item['ns'] | default('default') }}
|
namespace: {{ ns }}
|
||||||
spec:
|
spec:
|
||||||
displayName: {{ item['name'] | default(item['url'].split('/')[-1]) }}
|
displayName: {{ displayName }}
|
||||||
pvcName: ""
|
pvcName: ""
|
||||||
pvcNamespace: ""
|
pvcNamespace: ""
|
||||||
sourceType: download
|
sourceType: download
|
||||||
|
@ -5,7 +5,9 @@ Downloading image {{ filename }}:
|
|||||||
file.managed:
|
file.managed:
|
||||||
- name: /srv/www/htdocs/images/{{ dist }}/{{ filename }}
|
- name: /srv/www/htdocs/images/{{ dist }}/{{ filename }}
|
||||||
- source: {{ item['url'] }}
|
- source: {{ item['url'] }}
|
||||||
|
{% if 'checksum' in item -%}
|
||||||
- source_hash: {{ item['checksum'] }}
|
- source_hash: {{ item['checksum'] }}
|
||||||
|
{% endif %}
|
||||||
- user: root
|
- user: root
|
||||||
- group: root
|
- group: root
|
||||||
- mode: "0644"
|
- mode: "0644"
|
||||||
|
Loading…
Reference in New Issue
Block a user