Upgrade base image;Unpin ansible-core;Attempt different packer syntax
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2023-01-19 15:24:23 +01:00
parent 89532ff7fb
commit d915c21e44
4 changed files with 53 additions and 24 deletions

View File

@ -3,8 +3,8 @@ packages:
- jq
- python3-pip
pip:
# Some change causes high load during loops of importing/pushing container images
- ansible-core<2.14.0
# - ansible-core<2.14.0
- ansible-core
- jinja2
- lxml
- markupsafe

View File

@ -7,21 +7,6 @@ build {
source "vsphere-iso.ubuntu" {
name = "bootstrap"
vm_name = "${var.vm_name}-bootstrap"
export {
images = false
output_directory = "/scratch/airgapped-k8s/bootstrap"
}
}
source "vsphere-iso.ubuntu" {
name = "upgrade"
vm_name = "${var.vm_name}-upgrade"
export {
images = false
output_directory = "/scratch/airgapped-k8s/upgrade"
}
}
provisioner "ansible" {
@ -46,11 +31,49 @@ build {
inline = [
"pwsh -command \"& scripts/Update-OvfConfiguration.ps1 \\",
" -ApplianceType '${source.name} \\",
" -OVFFile '/scratch/airgapped-k8s/${source.name}/${var.vm_name}-${source.name}.ovf' \"",
" -OVFFile '/scratch/airgapped-k8s/${var.vm_name}-${source.name}.ovf' \"",
"pwsh -file scripts/Update-Manifest.ps1 \\",
" -ManifestFileName '/scratch/airgapped-k8s/${source.name}/${var.vm_name}-${source.name}.mf'",
" -ManifestFileName '/scratch/airgapped-k8s/${var.vm_name}-${source.name}.mf'",
"ovftool --acceptAllEulas --allowExtraConfig --overwrite \\",
" '/scratch/airgapped-k8s/${source.name}/${var.vm_name}-${source.name}.ovf' \\",
" '/scratch/airgapped-k8s/${var.vm_name}-${source.name}.ovf' \\",
" /output/airgapped-k8s.${source.name}.ova"
]
}
}
build {
source "vsphere-iso.ubuntu" {
name = "upgrade"
vm_name = "${var.vm_name}-upgrade"
}
provisioner "ansible" {
pause_before = "2m30s"
playbook_file = "ansible/playbook.yml"
user = "ubuntu"
ansible_env_vars = [
"ANSIBLE_CONFIG=ansible/ansible.cfg",
"PYTHONUNBUFFERED=1"
]
use_proxy = "false"
extra_arguments = [
"--extra-vars", "appliancetype=${source.name}",
"--extra-vars", "ansible_ssh_pass=${var.ssh_password}"//,
// "--extra-vars", "repo_username=${var.repo_username}",
// "--extra-vars", "repo_password=${var.repo_password}"
]
}
post-processor "shell-local" {
inline = [
"pwsh -command \"& scripts/Update-OvfConfiguration.ps1 \\",
" -ApplianceType '${source.name} \\",
" -OVFFile '/scratch/airgapped-k8s/${var.vm_name}-${source.name}.ovf' \"",
"pwsh -file scripts/Update-Manifest.ps1 \\",
" -ManifestFileName '/scratch/airgapped-k8s/${var.vm_name}-${source.name}.mf'",
"ovftool --acceptAllEulas --allowExtraConfig --overwrite \\",
" '/scratch/airgapped-k8s/${var.vm_name}-${source.name}.ovf' \\",
" /output/airgapped-k8s.${source.name}.ova"
]
}

View File

@ -1,4 +1,5 @@
iso_url = "sn.itch.fyi/Repository/iso/Canonical/Ubuntu%20Server%2022.04/ubuntu-22.04-live-server-amd64.iso"
iso_checksum = "sha256:84AEAF7823C8C61BAA0AE862D0A06B03409394800000B3235854A6B38EB4856F"
// iso_url = "sn.itch.fyi/Repository/iso/Canonical/Ubuntu%20Server%2020.04/ubuntu-20.04.2-live-server-amd64.iso"
// iso_checksum = "sha256:D1F2BF834BBE9BB43FAF16F9BE992A6F3935E65BE0EDECE1DEE2AA6EB1767423"
iso_url = "sn.itch.fyi/Repository/iso/Canonical/Ubuntu%20Server%2022.04/ubuntu-22.04.1-live-server-amd64.iso"
iso_checksum = "sha256:10F19C5B2B8D6DB711582E0E27F5116296C34FE4B313BA45F9B201A5007056CB"
// iso_url = "sn.itch.fyi/Repository/iso/Canonical/Ubuntu%20Server%2022.04/ubuntu-22.04-live-server-amd64.iso"
// iso_checksum = "sha256:84AEAF7823C8C61BAA0AE862D0A06B03409394800000B3235854A6B38EB4856F"

View File

@ -53,4 +53,9 @@ source "vsphere-iso" "ubuntu" {
shutdown_timeout = "5m"
remove_cdrom = true
export {
images = false
output_directory = "/scratch/airgapped-k8s"
}
}