Define install token;Change artifact path
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2023-01-19 13:30:13 +01:00
parent 849c86b22b
commit 52fbc561dd
3 changed files with 25 additions and 4 deletions

View File

@ -27,7 +27,7 @@
chdir: /opt/metacluster/k3s chdir: /opt/metacluster/k3s
environment: environment:
INSTALL_K3S_SKIP_DOWNLOAD: 'true' INSTALL_K3S_SKIP_DOWNLOAD: 'true'
INSTALL_K3S_EXEC: 'server --cluster-init --disable local-storage --config /etc/rancher/k3s/config.yaml' INSTALL_K3S_EXEC: 'server --cluster-init --token {{ vapp['metacluster.token'] }} --disable local-storage --config /etc/rancher/k3s/config.yaml'
when: ansible_facts.services['k3s.service'] is undefined when: ansible_facts.services['k3s.service'] is undefined
- name: Debug possible taints on k3s node - name: Debug possible taints on k3s node

View File

@ -7,11 +7,21 @@ build {
source "vsphere-iso.ubuntu" { source "vsphere-iso.ubuntu" {
name = "bootstrap" name = "bootstrap"
vm_name = "${var.vm_name}-bootstrap" vm_name = "${var.vm_name}-bootstrap"
export {
images = false
output_directory = "/scratch/airgapped-k8s/bootstrap"
}
} }
source "vsphere-iso.ubuntu" { source "vsphere-iso.ubuntu" {
name = "upgrade" name = "upgrade"
vm_name = "${var.vm_name}-upgrade" vm_name = "${var.vm_name}-upgrade"
export {
images = false
output_directory = "/scratch/airgapped-k8s/upgrade"
}
} }
provisioner "ansible" { provisioner "ansible" {
@ -36,11 +46,11 @@ build {
inline = [ inline = [
"pwsh -command \"& scripts/Update-OvfConfiguration.ps1 \\", "pwsh -command \"& scripts/Update-OvfConfiguration.ps1 \\",
" -ApplianceType '${source.name} \\", " -ApplianceType '${source.name} \\",
" -OVFFile '/scratch/airgapped-k8s/${var.vm_name}-${source.name}.ovf' \"", " -OVFFile '/scratch/airgapped-k8s/${source.name}/${var.vm_name}-${source.name}.ovf' \"",
"pwsh -file scripts/Update-Manifest.ps1 \\", "pwsh -file scripts/Update-Manifest.ps1 \\",
" -ManifestFileName '/scratch/airgapped-k8s/${var.vm_name}-${source.name}.mf'", " -ManifestFileName '/scratch/airgapped-k8s/${source.name}/${var.vm_name}-${source.name}.mf'",
"ovftool --acceptAllEulas --allowExtraConfig --overwrite \\", "ovftool --acceptAllEulas --allowExtraConfig --overwrite \\",
" '/scratch/airgapped-k8s/${var.vm_name}-${source.name}.ovf' \\", " '/scratch/airgapped-k8s/${source.name}/${var.vm_name}-${source.name}.ovf' \\",
" /output/airgapped-k8s.${source.name}.ova" " /output/airgapped-k8s.${source.name}.ova"
] ]
} }

View File

@ -31,6 +31,14 @@ PropertyCategories:
- Name: 1) Meta-cluster - Name: 1) Meta-cluster
ProductProperties: ProductProperties:
- key: metacluster.token
Type: string(1..)
Label: K3s install token*
Description: Auto-generated; this value is used to join future new nodes to the metacluster after deployment
DefaultValue: '{{ metacluster.token }}'
Configurations: '*'
UserConfigurable: true
- Key: guestinfo.hostname - Key: guestinfo.hostname
Type: string(1..15) Type: string(1..15)
Label: Hostname* Label: Hostname*
@ -173,3 +181,6 @@ Variables:
- Name: hostname.suffix - Name: hostname.suffix
Expression: | Expression: |
(-join ((48..57) + (97..122) | Get-Random -Count 5 | % {[char]$_})).ToLower() (-join ((48..57) + (97..122) | Get-Random -Count 5 | % {[char]$_})).ToLower()
- Name: metacluster.token
Expression: |
(New-Guid).Guid -replace '-', ''