Fix path;Debug packer contextual vars
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Danny Bessems 2023-01-19 21:15:48 +01:00
parent cd308d116b
commit 1428fe73f7
2 changed files with 9 additions and 34 deletions

View File

@ -27,7 +27,7 @@
- name: Copy payload folder (per appliancetype) - name: Copy payload folder (per appliancetype)
ansible.builtin.copy: ansible.builtin.copy:
src: ansible_payload/{{ appliancetype }} src: ansible_payload/{{ appliancetype }}/
dest: /opt/firstboot/ansible/ dest: /opt/firstboot/ansible/
owner: root owner: root
group: root group: root

View File

@ -9,44 +9,15 @@ build {
vm_name = "${var.vm_name}-bootstrap" vm_name = "${var.vm_name}-bootstrap"
} }
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"
]
}
}
build {
source "vsphere-iso.ubuntu" { source "vsphere-iso.ubuntu" {
name = "upgrade" name = "upgrade"
vm_name = "${var.vm_name}-upgrade" vm_name = "${var.vm_name}-upgrade"
} }
provisioner "shell" {
inline = ["echo ${source.name}"]
}
provisioner "ansible" { provisioner "ansible" {
pause_before = "2m30s" pause_before = "2m30s"
@ -65,6 +36,10 @@ build {
] ]
} }
provisioner "shell" {
inline = ["echo ${source.name}"]
}
post-processor "shell-local" { post-processor "shell-local" {
inline = [ inline = [
"pwsh -command \"& scripts/Update-OvfConfiguration.ps1 \\", "pwsh -command \"& scripts/Update-OvfConfiguration.ps1 \\",