{% for dist, items in pillar['tlu-harvester']['images'].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 kind: VirtualMachineImage metadata: name: {{ name }} namespace: {{ ns }} spec: displayName: {{ displayName }} pvcName: "" pvcNamespace: "" sourceType: download url: http://{{ pillar['network']['ip'] }}/images/{{ dist }}/{{ item['url'].split('/')[-1] }} {% endfor -%} {% endfor -%}