.
This commit is contained in:
parent
3387f1388d
commit
e3bae71113
@ -9,6 +9,12 @@ Configure wireguard service:
|
|||||||
- ports:
|
- ports:
|
||||||
- {{ pillar['wireguard']['port'] }}/udp
|
- {{ pillar['wireguard']['port'] }}/udp
|
||||||
|
|
||||||
|
Configure container registry service:
|
||||||
|
firewalld.service:
|
||||||
|
- name: registry
|
||||||
|
- ports:
|
||||||
|
- 5000/tcp
|
||||||
|
|
||||||
Configure firewalld for external interface:
|
Configure firewalld for external interface:
|
||||||
firewalld.present:
|
firewalld.present:
|
||||||
- name: external
|
- name: external
|
||||||
@ -45,6 +51,7 @@ Configure firewalld for internal network:
|
|||||||
- https
|
- https
|
||||||
- dns
|
- dns
|
||||||
- ntp
|
- ntp
|
||||||
|
- registry
|
||||||
|
|
||||||
Configure firewalld for public networks:
|
Configure firewalld for public networks:
|
||||||
firewalld.present:
|
firewalld.present:
|
||||||
@ -74,6 +81,7 @@ Configure firewalld for public networks:
|
|||||||
- https
|
- https
|
||||||
- dns
|
- dns
|
||||||
- ntp
|
- ntp
|
||||||
|
- registry
|
||||||
|
|
||||||
|
|
||||||
Configure firewalld for airgap networks:
|
Configure firewalld for airgap networks:
|
||||||
@ -104,6 +112,7 @@ Configure firewalld for airgap networks:
|
|||||||
- https
|
- https
|
||||||
- dns
|
- dns
|
||||||
- ntp
|
- ntp
|
||||||
|
- registry
|
||||||
|
|
||||||
Add forwarding on Internal zone:
|
Add forwarding on Internal zone:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
set menu_color_normal=white/black
|
set menu_color_normal=white/black
|
||||||
set menu_color_highlight=white/green
|
set menu_color_highlight=white/green
|
||||||
|
|
||||||
menuentry 'TLU Harvester {{ pillar['harvester']['version'] }} node1' --class os {
|
{% for node in ['node1', 'node2', 'node3'] -%}
|
||||||
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
|
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
|
initrd harvester-v{{ pillar['harvester']['version'] }}-initrd-amd64
|
||||||
boot
|
boot
|
||||||
}
|
}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
{% for item in pillar['pxe']['harvester'] -%}
|
{% for item in pillar['pxe']['harvester'] -%}
|
||||||
menuentry 'Harvester {{ item['version'] }}' --class os {
|
menuentry 'Harvester {{ item['version'] }}' --class os {
|
||||||
|
@ -1,13 +1,23 @@
|
|||||||
token: {{ pillar['harvester']['token'] }}
|
token: {{ pillar['harvester']['token'] }}
|
||||||
os:
|
os:
|
||||||
ssh_authorized_keys: {{ pillar['harvester']['os']['ssh_authorized_keys'] }}
|
ssh_authorized_keys: {{ pillar['harvester']['os']['ssh_authorized_keys'] }}
|
||||||
nostname: node1
|
hostname: node1
|
||||||
password: {{ pillar['harvester']['os']['password'] }}
|
password: {{ pillar['harvester']['os']['password'] }}
|
||||||
dns_nameservers:
|
dns_nameservers:
|
||||||
- {{ pillar['network']['ip'] }}
|
- {{ pillar['network']['ip'] }}
|
||||||
password: {{ pillar['harvester']['os']['password'] }}
|
password: {{ pillar['harvester']['os']['password'] }}
|
||||||
ntp_servers:
|
ntp_servers:
|
||||||
- {{ pillar['network']['ip'] }}
|
- {{ 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:
|
install:
|
||||||
mode: create
|
mode: create
|
||||||
networks:
|
networks:
|
||||||
|
34
salt/states/pxe/harvester/files/node2.yaml.jinja
Normal file
34
salt/states/pxe/harvester/files/node2.yaml.jinja
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
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
|
34
salt/states/pxe/harvester/files/node3.yaml.jinja
Normal file
34
salt/states/pxe/harvester/files/node3.yaml.jinja
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
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
|
@ -46,11 +46,13 @@ Update harvester grub file:
|
|||||||
- group: root
|
- group: root
|
||||||
- mode: "0644"
|
- mode: "0644"
|
||||||
|
|
||||||
Create tlu harvester cluster yaml for node1:
|
{% for node in ['node1', 'node2', 'node3'] -%}
|
||||||
|
Create tlu harvester cluster yaml for {{ node }}:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: /srv/www/htdocs/harvester/node1.yaml
|
- name: /srv/www/htdocs/harvester/{{ node }}.yaml
|
||||||
- source: salt://pxe/harvester/files/node1.yaml.jinja
|
- source: salt://pxe/harvester/files/{{ node }}.yaml.jinja
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- user: root
|
- user: root
|
||||||
- group: root
|
- group: root
|
||||||
- mode: "0644"
|
- mode: "0644"
|
||||||
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user