From be783f12edca47125e2fd7f59af8768f47419fc5 Mon Sep 17 00:00:00 2001 From: jonas Date: Mon, 18 Oct 2021 17:20:55 +0200 Subject: [PATCH] . --- ...penSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.yaml | 11 +++++++++++ manifests/tl-harvester/keypair/admin.yaml | 8 ++++++++ manifests/tl-harvester/keypair/exilio.yaml | 8 ++++++++ manifests/tl-harvester/networks/airgap.yaml | 7 +++++++ manifests/tl-harvester/networks/public-1.yaml | 7 +++++++ manifests/tl-harvester/networks/public-2.yaml | 7 +++++++ salt/pillars/images.sls | 4 ++++ salt/pillars/top.sls | 1 + salt/states/images/init.sls | 15 +++++++++++++++ salt/states/top.sls | 1 + 10 files changed, 69 insertions(+) create mode 100644 manifests/tl-harvester/images/openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.yaml create mode 100644 manifests/tl-harvester/keypair/admin.yaml create mode 100644 manifests/tl-harvester/keypair/exilio.yaml create mode 100644 manifests/tl-harvester/networks/airgap.yaml create mode 100644 manifests/tl-harvester/networks/public-1.yaml create mode 100644 manifests/tl-harvester/networks/public-2.yaml create mode 100644 salt/pillars/images.sls create mode 100644 salt/states/images/init.sls diff --git a/manifests/tl-harvester/images/openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.yaml b/manifests/tl-harvester/images/openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.yaml new file mode 100644 index 0000000..8c198ad --- /dev/null +++ b/manifests/tl-harvester/images/openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.yaml @@ -0,0 +1,11 @@ +apiVersion: harvesterhci.io/v1beta1 +kind: VirtualMachineImage +metadata: + name: 56e5b8adb10 + namespace: default +spec: + displayName: opensuse-leap-15.3-jeos.x86_64-kvm-and-xen.qcow2 + pvcName: "" + pvcNamespace: "" + sourceType: download + url: http://172.18.0.1/images/openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.qcow2 diff --git a/manifests/tl-harvester/keypair/admin.yaml b/manifests/tl-harvester/keypair/admin.yaml new file mode 100644 index 0000000..12591c1 --- /dev/null +++ b/manifests/tl-harvester/keypair/admin.yaml @@ -0,0 +1,8 @@ +apiVersion: harvesterhci.io/v1beta1 +kind: KeyPair +metadata: + name: admin + namespace: default +spec: + publicKey: | + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILGVNwMC2H+Fn4AhCDIa4MVfEYsVF7Zs2yHc8cGbv40l jonas@admin diff --git a/manifests/tl-harvester/keypair/exilio.yaml b/manifests/tl-harvester/keypair/exilio.yaml new file mode 100644 index 0000000..cfa0b8f --- /dev/null +++ b/manifests/tl-harvester/keypair/exilio.yaml @@ -0,0 +1,8 @@ +apiVersion: harvesterhci.io/v1beta1 +kind: KeyPair +metadata: + name: exilio + namespace: default +spec: + publicKey: | + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDSJ4KrM7iwmUyvOznqNiTaYOIVxpog7Ktfr2xaJgH6O jonas@exsilio diff --git a/manifests/tl-harvester/networks/airgap.yaml b/manifests/tl-harvester/networks/airgap.yaml new file mode 100644 index 0000000..72dce4d --- /dev/null +++ b/manifests/tl-harvester/networks/airgap.yaml @@ -0,0 +1,7 @@ +apiVersion: k8s.cni.cncf.io/v1 +kind: NetworkAttachmentDefinition +metadata: + name: airgap + namespace: default +spec: + config: '{"cniVersion":"0.3.1","name":"airgap","type":"bridge","bridge":"harvester-br0","promiscMode":true,"vlan":250,"ipam":{}}' diff --git a/manifests/tl-harvester/networks/public-1.yaml b/manifests/tl-harvester/networks/public-1.yaml new file mode 100644 index 0000000..2b7a4b2 --- /dev/null +++ b/manifests/tl-harvester/networks/public-1.yaml @@ -0,0 +1,7 @@ +apiVersion: k8s.cni.cncf.io/v1 +kind: NetworkAttachmentDefinition +metadata: + name: public-1 + namespace: default +spec: + config: '{"cniVersion":"0.3.1","name":"public-1","type":"bridge","bridge":"harvester-br0","promiscMode":true,"vlan":100,"ipam":{}}' diff --git a/manifests/tl-harvester/networks/public-2.yaml b/manifests/tl-harvester/networks/public-2.yaml new file mode 100644 index 0000000..6950f26 --- /dev/null +++ b/manifests/tl-harvester/networks/public-2.yaml @@ -0,0 +1,7 @@ +apiVersion: k8s.cni.cncf.io/v1 +kind: NetworkAttachmentDefinition +metadata: + name: public-2 + namespace: default +spec: + config: '{"cniVersion":"0.3.1","name":"public-2","type":"bridge","bridge":"harvester-br0","promiscMode":true,"vlan":200,"ipam":{}}' diff --git a/salt/pillars/images.sls b/salt/pillars/images.sls new file mode 100644 index 0000000..feb4604 --- /dev/null +++ b/salt/pillars/images.sls @@ -0,0 +1,4 @@ +images: + opensuse: + - url: https://download.opensuse.org/distribution/leap/15.3/appliances/openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.qcow2 + checksum: da11e3ed78cdadb0c8a15e9dd82c3c2b2746ba61cb98c3c03cfb156e5b8adb10 diff --git a/salt/pillars/top.sls b/salt/pillars/top.sls index 362ae4e..353a0ae 100644 --- a/salt/pillars/top.sls +++ b/salt/pillars/top.sls @@ -11,6 +11,7 @@ base: - hostapd - pxe - harvester_cluster + - images {% if salt['pillar.file_exists']('local.sls') %} - local {% endif %} diff --git a/salt/states/images/init.sls b/salt/states/images/init.sls new file mode 100644 index 0000000..ad1259a --- /dev/null +++ b/salt/states/images/init.sls @@ -0,0 +1,15 @@ +{% for distname, items in pillar['images'].items() %} +{% for item in items %} +{% set filename = item['url'].split('/')[-1] %} +Downloading image {{ filename }}: + file.managed: + - name: /srv/www/htdocs/images/{{ filename }} + - source: {{ item['url'] }} + - source_hash: {{ item['checksum'] }} + - user: root + - group: root + - mode: "0644" + - makedirs: True + - dir_mode: "0755" +{% endfor %} +{% endfor %} diff --git a/salt/states/top.sls b/salt/states/top.sls index b4ccd67..c8f61f6 100644 --- a/salt/states/top.sls +++ b/salt/states/top.sls @@ -15,3 +15,4 @@ base: - docker.registry - remote-desktop - wol + - images