Attempt to properly match build w/ source #2
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
8a753daed7
commit
3f2f19b36a
@ -6,45 +6,20 @@ packer {
|
|||||||
build {
|
build {
|
||||||
source "vsphere-iso.ubuntu" {
|
source "vsphere-iso.ubuntu" {
|
||||||
name = "bootstrap"
|
name = "bootstrap"
|
||||||
vm_name = "${var.vm_name}-{{ build `PackerRunUUID` }}"
|
vm_name = "${var.vm_name}-bootstrap"
|
||||||
}
|
|
||||||
|
|
||||||
provisioner "ansible" {
|
export {
|
||||||
pause_before = "2m30s"
|
output_directory = "/scratch/airgapped-k8s/bootstrap"
|
||||||
|
|
||||||
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}-{{ build `PackerRunUUID` }}.ovf' \"",
|
|
||||||
"pwsh -file scripts/Update-Manifest.ps1 \\",
|
|
||||||
" -ManifestFileName '/scratch/airgapped-k8s/${var.vm_name}-{{ build `PackerRunUUID` }}.mf'",
|
|
||||||
"ovftool --acceptAllEulas --allowExtraConfig --overwrite \\",
|
|
||||||
" '/scratch/airgapped-k8s/${var.vm_name}-{{ build `PackerRunUUID` }}.ovf' \\",
|
|
||||||
" /output/airgapped-k8s.${source.name}.ova"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
build {
|
|
||||||
source "vsphere-iso.ubuntu" {
|
source "vsphere-iso.ubuntu" {
|
||||||
name = "upgrade"
|
name = "upgrade"
|
||||||
vm_name = "${var.vm_name}-{{ build `PackerRunUUID` }}"
|
vm_name = "${var.vm_name}-upgrade"
|
||||||
|
|
||||||
|
export {
|
||||||
|
output_directory = "/scratch/airgapped-k8s/upgrade"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "ansible" {
|
provisioner "ansible" {
|
||||||
@ -69,11 +44,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}-{{ build `PackerRunUUID` }}.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}-{{ build `PackerRunUUID` }}.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}-{{ build `PackerRunUUID` }}.ovf' \\",
|
" '/scratch/airgapped-k8s/${source.name}/${var.vm_name}-${source.name}.ovf' \\",
|
||||||
" /output/airgapped-k8s.${source.name}.ova"
|
" /output/airgapped-k8s.${source.name}.ova"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,5 @@ source "vsphere-iso" "ubuntu" {
|
|||||||
|
|
||||||
export {
|
export {
|
||||||
images = false
|
images = false
|
||||||
output_directory = "/scratch/airgapped-k8s"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user