tlu/salt/states/tlu-harvester/files/manifests/images.yaml

20 lines
688 B
YAML
Raw Permalink Normal View History

2021-10-19 09:54:30 +00:00
{% for dist, items in pillar['tlu-harvester']['images'].items() -%}
{% for item in items -%}
2021-10-19 11:29:24 +00:00
{% 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' -%}
2021-10-19 09:54:30 +00:00
---
apiVersion: harvesterhci.io/v1beta1
kind: VirtualMachineImage
metadata:
2021-10-19 11:29:24 +00:00
name: {{ name }}
namespace: {{ ns }}
2021-10-19 09:54:30 +00:00
spec:
2021-10-19 11:29:24 +00:00
displayName: {{ displayName }}
2021-10-19 09:54:30 +00:00
pvcName: ""
pvcNamespace: ""
sourceType: download
url: http://{{ pillar['network']['ip'] }}/images/{{ dist }}/{{ item['url'].split('/')[-1] }}
{% endfor -%}
{% endfor -%}