Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use different name for builder and exported VM #539

Merged
merged 1 commit into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions packer/main.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ source "virtualbox-iso" "base-build" {
build {
source "source.virtualbox-iso.base-build" {
name = "mint"
vm_name = "${var.vm_name} Linux Mint ${var.semester}"
vm_name = "${var.vm_name} Linux Mint ${var.semester} Build ${local.build_id}"
iso_url = "${local.mint_info.mirror_url}/${local.mint_info.iso_file}"
iso_checksum = "file:${local.mint_info.mirror_url}/sha256sum.txt"
output_filename = "image-${lower(var.semester)}-mint"
Expand All @@ -79,13 +79,14 @@ build {
"--producturl", "https://linuxmint.com/",
"--vendor", "JMU Unix Users Group",
"--vendorurl", "${var.git_repo}",
"--version", "${var.mint_version.version}"
"--version", "${var.mint_version.version}",
"--vmname", "${var.vm_name} Linux Mint ${var.semester}"
]
}

source "source.virtualbox-iso.base-build" {
name = "ubuntu"
vm_name = "${var.vm_name} Ubuntu ${var.semester}"
vm_name = "${var.vm_name} Ubuntu ${var.semester} Build ${local.build_id}"
iso_url = "${local.ubuntu_info.mirror_url}/${local.ubuntu_info.iso_file}"
iso_checksum = "file:${local.ubuntu_info.mirror_url}/SHA256SUMS"
output_filename = "image-${lower(var.semester)}-ubuntu"
Expand All @@ -98,7 +99,8 @@ build {
"--producturl", "https://ubuntu.com/",
"--vendor", "JMU Unix Users Group",
"--vendorurl", "${var.git_repo}",
"--version", "${var.ubuntu_version.version}"
"--version", "${var.ubuntu_version.version}",
"--vmname", "${var.vm_name} Ubuntu ${var.semester}"
]
}

Expand Down
2 changes: 1 addition & 1 deletion packer/variables.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ variable "vm_name" {
}

locals {
build_id = "${legacy_isotime("2006-01-02")}"
build_id = formatdate("YYYY-MM-DD", timestamp())
ubuntu_info = {
mirror_url = "${var.mirror.base}/${var.mirror.ubuntu_path}/${var.ubuntu_version.version}"
iso_file = "ubuntu-${var.ubuntu_version.patched_version}-desktop-amd64.iso"
Expand Down
Loading