diff --git a/salt/pillars/harvester_cluster.sls b/salt/pillars/harvester_cluster.sls index 4bae517..1836efb 100644 --- a/salt/pillars/harvester_cluster.sls +++ b/salt/pillars/harvester_cluster.sls @@ -1,9 +1,12 @@ harvester: + version: 0.3.0 dns_host: harvester - token: ThisShouldBeConfiguredInYourlocal.sls + password: rancher + token: ThisShouldBeConfiguredInYour_local.sls os: ssh_authorized_keys: [] password: rancher install: - mgmt-interface: ensp2s0f0 + mgmt-interface: enp2s0f0 + device: /dev/nvme0n1 diff --git a/salt/states/pxe/harvester/files/harvester.cfg.jinja b/salt/states/pxe/harvester/files/harvester.cfg.jinja index 3a3149f..2e42ec7 100644 --- a/salt/states/pxe/harvester/files/harvester.cfg.jinja +++ b/salt/states/pxe/harvester/files/harvester.cfg.jinja @@ -1,11 +1,10 @@ -{% set cluster_version = 0.3.0 -%} ## Menu Colours set menu_color_normal=white/black set menu_color_highlight=white/green -menuentry 'TLU Harvester {{ cluster_version }} Server-1 --class os { - linux harvester-v{{ cluster_version }}-vmlinuz-amd64 nomodeset initrd=harvester-v{{ cluster_version }}-initrd-amd64 ip=dhcp net.ifnames=1 rd.cos.disable rd.noverifyssl console=tty1 root=live:http://{{ pillar['network']['ip'] }}/harvester/harvester-v{{ cluster_version }}-rootfs-amd64.squashfs iso_url=http://{{ pillar['network']['ip'] }}/harvester/harvester-v{{ cluster_version }}-amd64.iso harvester.install.automatic=true harvester.install.config_url=http://{{ pillar['network']['ip'] }}/harvester/tlu-cluster-create.yaml - initrd harvester-v{{ cluster_version }}-initrd-amd64 +menuentry 'TLU Harvester {{ pillar['harvester']['version'] }} node1' --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/node1.yaml + initrd harvester-v{{ pillar['harvester']['version'] }}-initrd-amd64 boot } diff --git a/salt/states/pxe/harvester/files/tlu-cluster-create.yaml.jinja b/salt/states/pxe/harvester/files/tlu-cluster-create.yaml.jinja deleted file mode 100644 index f0e03fe..0000000 --- a/salt/states/pxe/harvester/files/tlu-cluster-create.yaml.jinja +++ /dev/null @@ -1,21 +0,0 @@ -server_url: https://{{pillar['harvester']['dns_host'] }}.{{ pillar['network']['domain']}}:8443 -token: {{ pillar['harvester']['token'] }} -os: - ssh_authorized_keys: {{ pillar['harvester']['os']['ssh_authorized_keys'] }} - nostname: node1 - dns_nameservers: - - {{ pillar['network']['ip'] }} - password: {{ pillar['harvester']['os']['password'] }} -intall: - mode: create - networks: - harvester-mgmt: - interfaces: - - name: ensp2s0f0 - default_route: true - method: static - ip: {{ pillar['network']['ip][0:-1] }}21 - subnet_mask: 255.255.255.0 - gateway: {{ pillar['network']['ip'] }} - - device: /dev/nvme0n1 diff --git a/salt/states/pxe/harvester/init.sls b/salt/states/pxe/harvester/init.sls index c643beb..fa74fef 100644 --- a/salt/states/pxe/harvester/init.sls +++ b/salt/states/pxe/harvester/init.sls @@ -45,3 +45,12 @@ Update harvester grub file: - user: root - group: root - mode: "0644" + +Create tlu harvester cluster yaml for node1: + file.managed: + - name: /srv/www/htdocs/harvester/node1.yaml + - source: salt://pxe/harvester/files/node1.yaml.jinja + - template: jinja + - user: root + - group: root + - mode: "0644"