.
This commit is contained in:
parent
b9f68281af
commit
7a3fb412e0
14
salt/states/tlu-harvester/files/suse-images.yaml.jinja
Normal file
14
salt/states/tlu-harvester/files/suse-images.yaml.jinja
Normal 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 -%}
|
@ -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 }}
|
||||
|
Loading…
Reference in New Issue
Block a user