This commit is contained in:
jonas
2021-10-19 11:54:30 +02:00
parent be783f12ed
commit 6edffbc0fd
25 changed files with 139 additions and 89 deletions

View File

@@ -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

View File

@@ -1,35 +0,0 @@
token: {{ pillar['harvester']['token'] }}
os:
ssh_authorized_keys: {{ pillar['harvester']['os']['ssh_authorized_keys'] }}
hostname: node1
password: {{ pillar['harvester']['os']['password'] }}
dns_nameservers:
- {{ pillar['network']['ip'] }}
password: {{ pillar['harvester']['os']['password'] }}
ntp_servers:
- {{ pillar['network']['ip'] }}
write_files:
- path: /etc/rancher/rke2/registries.yaml
- owner: 'root:root'
- permissions: '0600'
- content: |
mirrors:
docker.io:
endpoint:
- "http://{{ pillar['network']['ip'] }}:5000"
install:
mode: create
networks:
harvester-mgmt:
interfaces:
- name: {{ pillar['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
vip: {{ pillar['network']['ip'][0:-1] }}{{ pillar['network']['hosts']['harvester'] }}
vip_mode: static

View File

@@ -1,34 +0,0 @@
server_url: https://harvester.{{ pillar['network']['domain'] }}:8443
token: {{ pillar['harvester']['token'] }}
os:
ssh_authorized_keys: {{ pillar['harvester']['os']['ssh_authorized_keys'] }}
hostname: node2
password: {{ pillar['harvester']['os']['password'] }}
dns_nameservers:
- {{ pillar['network']['ip'] }}
password: {{ pillar['harvester']['os']['password'] }}
ntp_servers:
- {{ pillar['network']['ip'] }}
write_files:
- path: /etc/rancher/rke2/registries.yaml
- owner: 'root:root'
- permissions: '0600'
- content: |
mirrors:
docker.io:
endpoint:
- "http://{{ pillar['network']['ip'] }}:5000"
install:
mode: join
networks:
harvester-mgmt:
interfaces:
- name: {{ pillar['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

View File

@@ -1,34 +0,0 @@
server_url: https://harvester.{{ pillar['network']['domain'] }}:8443
token: {{ pillar['harvester']['token'] }}
os:
ssh_authorized_keys: {{ pillar['harvester']['os']['ssh_authorized_keys'] }}
hostname: node3
password: {{ pillar['harvester']['os']['password'] }}
dns_nameservers:
- {{ pillar['network']['ip'] }}
password: {{ pillar['harvester']['os']['password'] }}
ntp_servers:
- {{ pillar['network']['ip'] }}
write_files:
- path: /etc/rancher/rke2/registries.yaml
- owner: 'root:root'
- permissions: '0600'
- content: |
mirrors:
docker.io:
endpoint:
- "http://{{ pillar['network']['ip'] }}:5000"
install:
mode: join
networks:
harvester-mgmt:
interfaces:
- name: {{ pillar['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

View File

@@ -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 %}