From 6edffbc0fd039483ffb940f1e8330958f400895f Mon Sep 17 00:00:00 2001 From: jonas Date: Tue, 19 Oct 2021 11:54:30 +0200 Subject: [PATCH] . --- ...USE-Leap-15.3-JeOS.x86_64-kvm-and-xen.yaml | 11 -------- 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/harvester_cluster.sls | 12 --------- salt/pillars/tlu-harvester.sls | 27 +++++++++++++++++++ salt/pillars/top.sls | 3 +-- salt/states/atftp/files/grub.cfg | 3 +++ salt/states/atftp/files/tlu-harvester.cfg | 9 +++++++ .../pxe/harvester/files/harvester.cfg.jinja | 8 ------ salt/states/pxe/harvester/init.sls | 11 -------- .../tlu-harvester/files/images/.gitignore | 4 +++ .../tlu-harvester/files}/keypair/admin.yaml | 0 .../tlu-harvester/files}/keypair/exilio.yaml | 0 .../tlu-harvester/files/manifests/images.sls | 16 +++++++++++ .../files/manifests/networks.yaml | 10 +++++++ .../files/node1.yaml.jinja | 14 +++++----- .../files/node2.yaml.jinja | 14 +++++----- .../files/node3.yaml.jinja | 14 +++++----- .../files/tlu-harvester.cfg.jinja | 11 ++++++++ .../init.sls => tlu-harvester/images.sls} | 4 +-- salt/states/tlu-harvester/init.sls | 4 +++ salt/states/tlu-harvester/manifests.sls | 11 ++++++++ salt/states/tlu-harvester/pxe.sls | 19 +++++++++++++ salt/states/top.sls | 2 +- 25 files changed, 139 insertions(+), 89 deletions(-) delete mode 100644 manifests/tl-harvester/images/openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.yaml delete mode 100644 manifests/tl-harvester/networks/airgap.yaml delete mode 100644 manifests/tl-harvester/networks/public-1.yaml delete mode 100644 manifests/tl-harvester/networks/public-2.yaml delete mode 100644 salt/pillars/harvester_cluster.sls create mode 100644 salt/pillars/tlu-harvester.sls create mode 100644 salt/states/atftp/files/tlu-harvester.cfg create mode 100644 salt/states/tlu-harvester/files/images/.gitignore rename {manifests/tl-harvester => salt/states/tlu-harvester/files}/keypair/admin.yaml (100%) rename {manifests/tl-harvester => salt/states/tlu-harvester/files}/keypair/exilio.yaml (100%) create mode 100644 salt/states/tlu-harvester/files/manifests/images.sls create mode 100644 salt/states/tlu-harvester/files/manifests/networks.yaml rename salt/states/{pxe/harvester => tlu-harvester}/files/node1.yaml.jinja (65%) rename salt/states/{pxe/harvester => tlu-harvester}/files/node2.yaml.jinja (64%) rename salt/states/{pxe/harvester => tlu-harvester}/files/node3.yaml.jinja (64%) create mode 100644 salt/states/tlu-harvester/files/tlu-harvester.cfg.jinja rename salt/states/{images/init.sls => tlu-harvester/images.sls} (71%) create mode 100644 salt/states/tlu-harvester/init.sls create mode 100644 salt/states/tlu-harvester/manifests.sls create mode 100644 salt/states/tlu-harvester/pxe.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 deleted file mode 100644 index 8c198ad..0000000 --- a/manifests/tl-harvester/images/openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.yaml +++ /dev/null @@ -1,11 +0,0 @@ -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/networks/airgap.yaml b/manifests/tl-harvester/networks/airgap.yaml deleted file mode 100644 index 72dce4d..0000000 --- a/manifests/tl-harvester/networks/airgap.yaml +++ /dev/null @@ -1,7 +0,0 @@ -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 deleted file mode 100644 index 2b7a4b2..0000000 --- a/manifests/tl-harvester/networks/public-1.yaml +++ /dev/null @@ -1,7 +0,0 @@ -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 deleted file mode 100644 index 6950f26..0000000 --- a/manifests/tl-harvester/networks/public-2.yaml +++ /dev/null @@ -1,7 +0,0 @@ -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/harvester_cluster.sls b/salt/pillars/harvester_cluster.sls deleted file mode 100644 index 1836efb..0000000 --- a/salt/pillars/harvester_cluster.sls +++ /dev/null @@ -1,12 +0,0 @@ -harvester: - version: 0.3.0 - dns_host: harvester - password: rancher - token: ThisShouldBeConfiguredInYour_local.sls - os: - ssh_authorized_keys: [] - password: rancher - install: - mgmt-interface: enp2s0f0 - device: /dev/nvme0n1 - diff --git a/salt/pillars/tlu-harvester.sls b/salt/pillars/tlu-harvester.sls new file mode 100644 index 0000000..7a7aee7 --- /dev/null +++ b/salt/pillars/tlu-harvester.sls @@ -0,0 +1,27 @@ +tlu-harvester: + version: 0.3.0 + dns_host: harvester + password: rancher + token: ThisShouldBeConfiguredInYour_local.sls + os: + ssh_authorized_keys: [] + password: rancher + install: + mgmt-interface: enp2s0f0 + device: /dev/nvme0n1 + + + images: + opensuse: + - name: openSUSE Leap 15.3 + url: https://download.opensuse.org/distribution/leap/15.3/appliances/openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.qcow2 + checksum: da11e3ed78cdadb0c8a15e9dd82c3c2b2746ba61cb98c3c03cfb156e5b8adb10 + ns: default + ubuntu: + - name: ubuntu 20.04 (Focal Fossa) + url: https://cloud-images.ubuntu.com/focal/20211015/focal-server-cloudimg-amd64-disk-kvm.img + checksum: 8ba7a402852a8379ecc305fd518d26cdf012e7809134c3d2d4029a67990c8e33 + ns: default + - name: ubuntu 21.04 (Hirsute Hippo) + url: https://cloud-images.ubuntu.com/hirsute/20211017/hirsute-server-cloudimg-amd64-disk-kvm.img + checksum: 0c4113189d14f4d4d1a8933318b40f69500bbe9ebf58864703a3e333f5355065 diff --git a/salt/pillars/top.sls b/salt/pillars/top.sls index 353a0ae..88cf51b 100644 --- a/salt/pillars/top.sls +++ b/salt/pillars/top.sls @@ -10,8 +10,7 @@ base: - wireguard - hostapd - pxe - - harvester_cluster - - images + - tlu-harvester {% if salt['pillar.file_exists']('local.sls') %} - local {% endif %} diff --git a/salt/states/atftp/files/grub.cfg b/salt/states/atftp/files/grub.cfg index e9effbe..c700f3d 100644 --- a/salt/states/atftp/files/grub.cfg +++ b/salt/states/atftp/files/grub.cfg @@ -17,6 +17,9 @@ menuentry 'Continue to normal BIOS boot' --id boot-bios --class exit { submenu "Harvester ->" { configfile harvester.cfg } +submenu "TLU Harvester Cluster->" { + configfile tlu-harvester.cfg +} submenu "openSUSE ->" { diff --git a/salt/states/atftp/files/tlu-harvester.cfg b/salt/states/atftp/files/tlu-harvester.cfg new file mode 100644 index 0000000..e0cb158 --- /dev/null +++ b/salt/states/atftp/files/tlu-harvester.cfg @@ -0,0 +1,9 @@ +# Visual +GRUB_GFXMODE=1024x768x32 +GRUB_GFXPAYLOAD_LINUX=keep +## Menu Colours +set menu_color_normal=white/black +set menu_color_highlight=white/green + +menuentry 'Harvester 0.3.0' --class os { +} diff --git a/salt/states/pxe/harvester/files/harvester.cfg.jinja b/salt/states/pxe/harvester/files/harvester.cfg.jinja index 934b71d..191164c 100644 --- a/salt/states/pxe/harvester/files/harvester.cfg.jinja +++ b/salt/states/pxe/harvester/files/harvester.cfg.jinja @@ -2,14 +2,6 @@ set menu_color_normal=white/black set menu_color_highlight=white/green -{% for node in ['node1', 'node2', 'node3'] -%} -menuentry 'TLU Harvester {{ pillar['harvester']['version'] }} {{ node }}' --class os { - linux harvester-v{{ pillar['harvester']['version'] }}-vmlinuz-amd64 nomodeset initrd=harvester-v{{ pillar['harvester']['version'] }}-initrd-amd64 ip=dhcp net.ifnames=1 rd.cos.disable rd.noverifyssl console=tty1 root=live:http://{{ pillar['network']['ip'] }}/harvester/harvester-v{{ pillar['harvester']['version'] }}-rootfs-amd64.squashfs harvester.install.automatic=true harvester.install.config_url=http://{{ pillar['network']['ip'] }}/harvester/{{ node }}.yaml - initrd harvester-v{{ pillar['harvester']['version'] }}-initrd-amd64 - boot -} -{% endfor %} - {% for item in pillar['pxe']['harvester'] -%} menuentry 'Harvester {{ item['version'] }}' --class os { linux harvester-v{{ item['version'] }}-vmlinuz-amd64 nomodeset initrd=harvester-v{{ item['version'] }}-initrd-amd64 ip=dhcp net.ifnames=1 rd.cos.disable rd.noverifyssl console=tty1 root=live:http://{{ pillar['network']['ip'] }}/harvester/harvester-v{{ item['version'] }}-rootfs-amd64.squashfs iso_url=http://{{ pillar['network']['ip'] }}/harvester/harvester-v{{ item['version'] }}-amd64.iso diff --git a/salt/states/pxe/harvester/init.sls b/salt/states/pxe/harvester/init.sls index 44fef9b..c643beb 100644 --- a/salt/states/pxe/harvester/init.sls +++ b/salt/states/pxe/harvester/init.sls @@ -45,14 +45,3 @@ Update harvester grub file: - user: root - group: root - mode: "0644" - -{% for node in ['node1', 'node2', 'node3'] -%} -Create tlu harvester cluster yaml for {{ node }}: - file.managed: - - name: /srv/www/htdocs/harvester/{{ node }}.yaml - - source: salt://pxe/harvester/files/{{ node }}.yaml.jinja - - template: jinja - - user: root - - group: root - - mode: "0644" -{% endfor %} diff --git a/salt/states/tlu-harvester/files/images/.gitignore b/salt/states/tlu-harvester/files/images/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/salt/states/tlu-harvester/files/images/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/manifests/tl-harvester/keypair/admin.yaml b/salt/states/tlu-harvester/files/keypair/admin.yaml similarity index 100% rename from manifests/tl-harvester/keypair/admin.yaml rename to salt/states/tlu-harvester/files/keypair/admin.yaml diff --git a/manifests/tl-harvester/keypair/exilio.yaml b/salt/states/tlu-harvester/files/keypair/exilio.yaml similarity index 100% rename from manifests/tl-harvester/keypair/exilio.yaml rename to salt/states/tlu-harvester/files/keypair/exilio.yaml diff --git a/salt/states/tlu-harvester/files/manifests/images.sls b/salt/states/tlu-harvester/files/manifests/images.sls new file mode 100644 index 0000000..cbbb913 --- /dev/null +++ b/salt/states/tlu-harvester/files/manifests/images.sls @@ -0,0 +1,16 @@ +{% for dist, items in pillar['tlu-harvester']['images'].items() -%} +{% for item in items -%} +--- +apiVersion: harvesterhci.io/v1beta1 +kind: VirtualMachineImage +metadata: + name: {{ item['checksum'][-10:] }} + namespace: {{ item['ns'] | default('default') }} +spec: + displayName: {{ item['name'] | default(item['url'].split('/')[-1]) }} + pvcName: "" + pvcNamespace: "" + sourceType: download + url: http://{{ pillar['network']['ip'] }}/images/{{ dist }}/{{ item['url'].split('/')[-1] }} +{% endfor -%} +{% endfor -%} diff --git a/salt/states/tlu-harvester/files/manifests/networks.yaml b/salt/states/tlu-harvester/files/manifests/networks.yaml new file mode 100644 index 0000000..3ca4504 --- /dev/null +++ b/salt/states/tlu-harvester/files/manifests/networks.yaml @@ -0,0 +1,10 @@ +{% for vlan in pillar['network']['vlan'] %} +--- +apiVersion: k8s.cni.cncf.io/v1 +kind: NetworkAttachmentDefinition +metadata: + name: {{ vlan['zone'] }}-{{ vlan['id'] }} + namespace: default +spec: + config: '{"cniVersion":"0.3.1","name":"{{ vlan['zone'] }}-{{ vlan['id'] }}","type":"bridge","bridge":"harvester-br0","promiscMode":true,"vlan":{{ vlan['id'] }},"ipam":{}}' +{% endfor %} diff --git a/salt/states/pxe/harvester/files/node1.yaml.jinja b/salt/states/tlu-harvester/files/node1.yaml.jinja similarity index 65% rename from salt/states/pxe/harvester/files/node1.yaml.jinja rename to salt/states/tlu-harvester/files/node1.yaml.jinja index ad75b4c..861bbe2 100644 --- a/salt/states/pxe/harvester/files/node1.yaml.jinja +++ b/salt/states/tlu-harvester/files/node1.yaml.jinja @@ -1,11 +1,11 @@ -token: {{ pillar['harvester']['token'] }} +token: {{ pillar['tlu-harvester']['token'] }} os: - ssh_authorized_keys: {{ pillar['harvester']['os']['ssh_authorized_keys'] }} + ssh_authorized_keys: {{ pillar['tlu-harvester']['os']['ssh_authorized_keys'] }} hostname: node1 - password: {{ pillar['harvester']['os']['password'] }} + password: {{ pillar['tlu-harvester']['os']['password'] }} dns_nameservers: - {{ pillar['network']['ip'] }} - password: {{ pillar['harvester']['os']['password'] }} + password: {{ pillar['tlu-harvester']['os']['password'] }} ntp_servers: - {{ pillar['network']['ip'] }} write_files: @@ -23,13 +23,13 @@ install: networks: harvester-mgmt: interfaces: - - name: {{ pillar['harvester']['install']['mgmt-interface'] }} + - name: {{ pillar['tlu-harvester']['install']['mgmt-interface'] }} method: static ip: {{ pillar['network']['ip'][0:-1] }}{{ pillar['network']['hosts']['node1'] }} subnet_mask: 255.255.255.0 gateway: {{ pillar['network']['ip'] }} default_route: true - device: {{ pillar['harvester']['device'] }} - iso_url: http://{{ pillar['network']['ip'] }}/harvester/harvester-v{{ pillar['harvester']['version'] }}-amd64.iso + device: {{ pillar['tlu-harvester']['device'] }} + iso_url: http://{{ pillar['network']['ip'] }}/harvester/harvester-v{{ pillar['tlu-harvester']['version'] }}-amd64.iso vip: {{ pillar['network']['ip'][0:-1] }}{{ pillar['network']['hosts']['harvester'] }} vip_mode: static diff --git a/salt/states/pxe/harvester/files/node2.yaml.jinja b/salt/states/tlu-harvester/files/node2.yaml.jinja similarity index 64% rename from salt/states/pxe/harvester/files/node2.yaml.jinja rename to salt/states/tlu-harvester/files/node2.yaml.jinja index 0a836a4..f632d35 100644 --- a/salt/states/pxe/harvester/files/node2.yaml.jinja +++ b/salt/states/tlu-harvester/files/node2.yaml.jinja @@ -1,12 +1,12 @@ server_url: https://harvester.{{ pillar['network']['domain'] }}:8443 -token: {{ pillar['harvester']['token'] }} +token: {{ pillar['tlu-harvester']['token'] }} os: - ssh_authorized_keys: {{ pillar['harvester']['os']['ssh_authorized_keys'] }} + ssh_authorized_keys: {{ pillar['tlu-harvester']['os']['ssh_authorized_keys'] }} hostname: node2 - password: {{ pillar['harvester']['os']['password'] }} + password: {{ pillar['tlu-harvester']['os']['password'] }} dns_nameservers: - {{ pillar['network']['ip'] }} - password: {{ pillar['harvester']['os']['password'] }} + password: {{ pillar['tlu-harvester']['os']['password'] }} ntp_servers: - {{ pillar['network']['ip'] }} write_files: @@ -24,11 +24,11 @@ install: networks: harvester-mgmt: interfaces: - - name: {{ pillar['harvester']['install']['mgmt-interface'] }} + - name: {{ pillar['tlu-harvester']['install']['mgmt-interface'] }} method: static ip: {{ pillar['network']['ip'][0:-1] }}{{ pillar['network']['hosts']['node2'] }} subnet_mask: 255.255.255.0 gateway: {{ pillar['network']['ip'] }} default_route: true - device: {{ pillar['harvester']['device'] }} - iso_url: http://{{ pillar['network']['ip'] }}/harvester/harvester-v{{ pillar['harvester']['version'] }}-amd64.iso + device: {{ pillar['tlu-harvester']['device'] }} + iso_url: http://{{ pillar['network']['ip'] }}/harvester/harvester-v{{ pillar['tlu-harvester']['version'] }}-amd64.iso diff --git a/salt/states/pxe/harvester/files/node3.yaml.jinja b/salt/states/tlu-harvester/files/node3.yaml.jinja similarity index 64% rename from salt/states/pxe/harvester/files/node3.yaml.jinja rename to salt/states/tlu-harvester/files/node3.yaml.jinja index 3cc9008..8ee8151 100644 --- a/salt/states/pxe/harvester/files/node3.yaml.jinja +++ b/salt/states/tlu-harvester/files/node3.yaml.jinja @@ -1,12 +1,12 @@ server_url: https://harvester.{{ pillar['network']['domain'] }}:8443 -token: {{ pillar['harvester']['token'] }} +token: {{ pillar['tlu-harvester']['token'] }} os: - ssh_authorized_keys: {{ pillar['harvester']['os']['ssh_authorized_keys'] }} + ssh_authorized_keys: {{ pillar['tlu-harvester']['os']['ssh_authorized_keys'] }} hostname: node3 - password: {{ pillar['harvester']['os']['password'] }} + password: {{ pillar['tlu-harvester']['os']['password'] }} dns_nameservers: - {{ pillar['network']['ip'] }} - password: {{ pillar['harvester']['os']['password'] }} + password: {{ pillar['tlu-harvester']['os']['password'] }} ntp_servers: - {{ pillar['network']['ip'] }} write_files: @@ -24,11 +24,11 @@ install: networks: harvester-mgmt: interfaces: - - name: {{ pillar['harvester']['install']['mgmt-interface'] }} + - name: {{ pillar['tlu-harvester']['install']['mgmt-interface'] }} method: static ip: {{ pillar['network']['ip'][0:-1] }}{{ pillar['network']['hosts']['node3'] }} subnet_mask: 255.255.255.0 gateway: {{ pillar['network']['ip'] }} default_route: true - device: {{ pillar['harvester']['device'] }} - iso_url: http://{{ pillar['network']['ip'] }}/harvester/harvester-v{{ pillar['harvester']['version'] }}-amd64.iso + device: {{ pillar['tlu-harvester']['device'] }} + iso_url: http://{{ pillar['network']['ip'] }}/harvester/harvester-v{{ pillar['tlu-harvester']['version'] }}-amd64.iso diff --git a/salt/states/tlu-harvester/files/tlu-harvester.cfg.jinja b/salt/states/tlu-harvester/files/tlu-harvester.cfg.jinja new file mode 100644 index 0000000..8b65bff --- /dev/null +++ b/salt/states/tlu-harvester/files/tlu-harvester.cfg.jinja @@ -0,0 +1,11 @@ +## Menu Colours +set menu_color_normal=white/black +set menu_color_highlight=white/green + +{% for node in ['node1', 'node2', 'node3'] -%} +menuentry 'TLU Harvester {{ pillar['tlu-harvester']['version'] }} {{ node }}' --class os { + linux harvester-v{{ pillar['tlu-harvester']['version'] }}-vmlinuz-amd64 nomodeset initrd=harvester-v{{ pillar['tlu-harvester']['version'] }}-initrd-amd64 ip=dhcp net.ifnames=1 rd.cos.disable rd.noverifyssl console=tty1 root=live:http://{{ pillar['network']['ip'] }}/harvester/harvester-v{{ pillar['tlu-harvester']['version'] }}-rootfs-amd64.squashfs harvester.install.automatic=true harvester.install.config_url=http://{{ pillar['network']['ip'] }}/harvester/{{ node }}.yaml + initrd harvester-v{{ pillar['tlu-harvester']['version'] }}-initrd-amd64 + boot +} +{% endfor %} diff --git a/salt/states/images/init.sls b/salt/states/tlu-harvester/images.sls similarity index 71% rename from salt/states/images/init.sls rename to salt/states/tlu-harvester/images.sls index ad1259a..494300d 100644 --- a/salt/states/images/init.sls +++ b/salt/states/tlu-harvester/images.sls @@ -1,9 +1,9 @@ -{% for distname, items in pillar['images'].items() %} +{% for dist, items in pillar['tlu-harvester']['images'].items() %} {% for item in items %} {% set filename = item['url'].split('/')[-1] %} Downloading image {{ filename }}: file.managed: - - name: /srv/www/htdocs/images/{{ filename }} + - name: /srv/www/htdocs/images/{{ dist }}/{{ filename }} - source: {{ item['url'] }} - source_hash: {{ item['checksum'] }} - user: root diff --git a/salt/states/tlu-harvester/init.sls b/salt/states/tlu-harvester/init.sls new file mode 100644 index 0000000..bcaa97f --- /dev/null +++ b/salt/states/tlu-harvester/init.sls @@ -0,0 +1,4 @@ +include: + - tlu-harvester.pxe + - tlu-harvester.manifests + - tlu-harvester.images diff --git a/salt/states/tlu-harvester/manifests.sls b/salt/states/tlu-harvester/manifests.sls new file mode 100644 index 0000000..99bfe6a --- /dev/null +++ b/salt/states/tlu-harvester/manifests.sls @@ -0,0 +1,11 @@ +Add tlu-harvester manifests: + file.recurse: + - name: /home/{{ pillar['username'] }}/tlu-harvester + - source: salt://tlu-harvester/files/manifests + - template: jinja + - user: {{ pillar['username'] }} + - group: users + - file_mode: "0600" + - include_empty: True + - makedirs: True + - dir_modes: "0700" diff --git a/salt/states/tlu-harvester/pxe.sls b/salt/states/tlu-harvester/pxe.sls new file mode 100644 index 0000000..a5e10fb --- /dev/null +++ b/salt/states/tlu-harvester/pxe.sls @@ -0,0 +1,19 @@ +{% for node in ['node1', 'node2', 'node3'] -%} +Create tlu harvester cluster yaml for {{ node }}: + file.managed: + - name: /srv/www/htdocs/harvester/{{ node }}.yaml + - source: salt://tlu-harvester/files/{{ node }}.yaml.jinja + - template: jinja + - user: root + - group: root + - mode: "0644" +{% endfor %} + +Update harvester grub file: + file.managed: + - name: /srv/tftpboot/tlu-harvester.cfg + - source: salt://tlu-harvester/files/tlu-harvester.cfg.jinja + - template: jinja + - user: root + - group: root + - mode: "0644" diff --git a/salt/states/top.sls b/salt/states/top.sls index c8f61f6..1fef4a0 100644 --- a/salt/states/top.sls +++ b/salt/states/top.sls @@ -15,4 +15,4 @@ base: - docker.registry - remote-desktop - wol - - images + - tlu-harvester