This commit is contained in:
jonas 2021-10-20 15:51:48 +02:00
parent b9f68281af
commit 7a3fb412e0
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,14 @@
{% for image in images -%}
---
apiVersion: harvesterhci.io/v1beta1
kind: VirtualMachineImage
metadata:
name: {{ salt['random.hash'](image, 'md5')[-10:] }}
namespace: default
spec:
displayName: {{ image }}
pvcName: ""
pvcNamespace: ""
sourceType: download
url: http://{{ pillar['network']['ip'] }}/images/suse/{{ image }}
{% endfor -%}

View File

@ -9,3 +9,15 @@ Add tlu-harvester manifests:
- include_empty: True
- makedirs: True
- dir_modes: "0700"
{%- set images = salt['file.find']('/srv/www/htdocs/images/suse',type='f',mindepth=1,maxdepth=1,print='name') %}
Adding image manifest for SUSE images:
file.managed:
- name: /home/{{ pillar['username'] }}/tlu-harvester/suse-images.yaml
- source: salt://tlu-harvester/files/suse-images.yaml.jinja
- template: jinja
- user: {{ pillar['username'] }}
- group: users
- mode: "0600"
- context:
images: {{ images }}