Skip to content

Commit

Permalink
fix metadata basename (#1548)
Browse files Browse the repository at this point in the history
fixed metadata base_boxname
updated debian 11 to 11.9
updated debian 12 to 12.5
  • Loading branch information
Stromweld authored Feb 16, 2024
1 parent 7bbfea4 commit 3094137
Show file tree
Hide file tree
Showing 23 changed files with 784 additions and 44 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@ Markdown table generated at <https://www.tablesgenerator.com/markdown_tables#>
- Create CD pipeline to build and upload new versions of vagrant boxes once every 3 months with the latest patches
- Added ability to configure bento upload of private or public boxes in builds.yml, defaults to private

## [unreleased] (2024-02-05)
## [unreleased] (2024-02-16)

## [v4.0.1] (2024-02-16)

- Fix metadata file box_basename
- Updated Debian 11 to 11.9
- Updated Debian 12 to 12.5
- Added Windows 11 aarch64 template

## [v4.0.0] (2024-02-05)

Expand Down
2 changes: 1 addition & 1 deletion lib/bento/buildmetadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def read
attr_reader :template, :build_timestamp, :override_version, :pkr_cmd

def box_basename
name.gsub('/', '__').split('-')[0...-1].join('-')
name.gsub('/', '__').split('-').join('-')
end

def git_revision
Expand Down
4 changes: 2 additions & 2 deletions os_pkrvars/debian/debian-11-aarch64.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
os_name = "debian"
os_version = "11.8"
os_version = "11.9"
os_arch = "aarch64"
iso_url = "https://cdimage.debian.org/cdimage/archive/latest-oldstable/arm64/iso-dvd/debian-11.8.0-arm64-DVD-1.iso"
iso_url = "https://cdimage.debian.org/cdimage/archive/latest-oldstable/arm64/iso-dvd/debian-11.9.0-arm64-DVD-1.iso"
iso_checksum = "file:https://cdimage.debian.org/cdimage/archive/latest-oldstable/arm64/iso-dvd/SHA256SUMS"
parallels_guest_os_type = "debian"
vbox_guest_os_type = "Debian_64"
Expand Down
4 changes: 2 additions & 2 deletions os_pkrvars/debian/debian-11-x86_64.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
os_name = "debian"
os_version = "11.8"
os_version = "11.9"
os_arch = "x86_64"
iso_url = "https://cdimage.debian.org/cdimage/archive/latest-oldstable/amd64/iso-dvd/debian-11.8.0-amd64-DVD-1.iso"
iso_url = "https://cdimage.debian.org/cdimage/archive/latest-oldstable/amd64/iso-dvd/debian-11.9.0-amd64-DVD-1.iso"
iso_checksum = "file:https://cdimage.debian.org/cdimage/archive/latest-oldstable/amd64/iso-dvd/SHA256SUMS"
parallels_guest_os_type = "debian"
vbox_guest_os_type = "Debian_64"
Expand Down
6 changes: 3 additions & 3 deletions os_pkrvars/debian/debian-12-aarch64.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
os_name = "debian"
os_version = "12.4"
os_version = "12.5"
os_arch = "aarch64"
iso_url = "https://cdimage.debian.org/cdimage/release/12.4.0/arm64/iso-dvd/debian-12.4.0-arm64-DVD-1.iso"
iso_checksum = "file:https://cdimage.debian.org/cdimage/release/12.4.0/arm64/iso-dvd/SHA256SUMS"
iso_url = "https://cdimage.debian.org/cdimage/release/12.5.0/arm64/iso-dvd/debian-12.5.0-arm64-DVD-1.iso"
iso_checksum = "file:https://cdimage.debian.org/cdimage/release/12.5.0/arm64/iso-dvd/SHA256SUMS"
parallels_guest_os_type = "debian"
vbox_guest_os_type = "Debian_64"
vmware_guest_os_type = "arm-debian-64"
Expand Down
6 changes: 3 additions & 3 deletions os_pkrvars/debian/debian-12-x86_64.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
os_name = "debian"
os_version = "12.4"
os_version = "12.5"
os_arch = "x86_64"
iso_url = "https://cdimage.debian.org/cdimage/release/12.4.0/amd64/iso-dvd/debian-12.4.0-amd64-DVD-1.iso"
iso_checksum = "file:https://cdimage.debian.org/cdimage/release/12.4.0/amd64/iso-dvd/SHA256SUMS"
iso_url = "https://cdimage.debian.org/cdimage/release/12.5.0/amd64/iso-dvd/debian-12.5.0-amd64-DVD-1.iso"
iso_checksum = "file:https://cdimage.debian.org/cdimage/release/12.5.0/amd64/iso-dvd/SHA256SUMS"
parallels_guest_os_type = "debian"
vbox_guest_os_type = "Debian_64"
vmware_guest_os_type = "debian-64"
Expand Down
1 change: 0 additions & 1 deletion os_pkrvars/windows/windows-10-x86_64.pkrvars.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ iso_checksum = "ef7312733a9f5d7d51cfa04ac497671995674ca5e1058d5164d60
parallels_guest_os_type = "win-10"
vbox_guest_os_type = "Windows10_64"
vmware_guest_os_type = "windows9srv-64"

9 changes: 9 additions & 0 deletions os_pkrvars/windows/windows-11-aarch64.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
os_name = "windows"
os_version = "11"
os_arch = "aarch64"
is_windows = true
iso_url = "../../builds/iso/WIN11_PROFESSIONAL_ARM64_EN-US.ISO"
iso_checksum = "90d4f9b5377e3c41784696ad0bb021b690e4f981f8e278fad62e07726f86bd77"
parallels_guest_os_type = "win-11"
vbox_guest_os_type = "Windows11_64"
vmware_guest_os_type = "windows9srv-64"
2 changes: 2 additions & 0 deletions packer_templates/http/ubuntu/user-data
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ autoinstall:
install-server: yes
allow-pw: yes
late-commands:
- sed -i 's/^#*\(send dhcp-client-identifier\).*$/\1 = hardware;/' /target/etc/dhcp/dhclient.conf
- 'sed -i "s/dhcp4: true/&\n dhcp-identifier: mac/" /target/etc/netplan/00-installer-config.yaml'
- echo 'vagrant ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/vagrant
# Enable hyper-v daemons only if using hyper-v virtualization
- if [ $(virt-what) == "hyperv" ]; then apt-get update && apt-get install -y hyperv-daemons linux-tools-$(uname -r) linux-cloud-tools-$(uname -r) linux-cloud-tools-common cifs-utils && systemctl enable hypervvssd && systemctl enable hypervkvpd && systemctl start hypervvssd && systemctl start hypervkvpd; fi
4 changes: 1 addition & 3 deletions packer_templates/pkr-builder.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ locals {
"${var.os_name}-${substr(var.os_version, 0, 1)}" == "amazonlinux-2" ||
"${var.os_name}-${substr(var.os_version, 0, 1)}" == "centos-7" ||
"${var.os_name}-${substr(var.os_version, 0, 1)}" == "oracle-7" ||
"${var.os_name}-${substr(var.os_version, 0, 1)}" == "rhel-7" ||
"${var.os_name}-${substr(var.os_version, 0, 1)}" == "scientificlinux-7" ||
"${var.os_name}-${substr(var.os_version, 0, 1)}" == "springdalelinux-7" ? [
"${var.os_name}-${substr(var.os_version, 0, 1)}" == "rhel-7" ? [
"${path.root}/scripts/rhel/update_yum.sh",
"${path.root}/scripts/_common/motd.sh",
"${path.root}/scripts/_common/sshd.sh",
Expand Down
40 changes: 22 additions & 18 deletions packer_templates/pkr-sources.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ locals {
# Source block provider specific
# hyperv-iso
hyperv_enable_dynamic_memory = var.hyperv_enable_dynamic_memory == null ? (
var.hyperv_generation == 2 && var.is_windows ? "true" : null
var.hyperv_generation == 2 && var.is_windows ? true : false
) : var.hyperv_enable_dynamic_memory
hyperv_enable_secure_boot = var.hyperv_enable_secure_boot == null ? (
var.hyperv_generation == 2 && var.is_windows ? false : null
var.hyperv_generation == 2 && var.is_windows ? true : false
) : var.hyperv_enable_secure_boot

# parallels-iso
Expand All @@ -21,11 +21,10 @@ locals {
) : var.parallels_tools_mode
parallels_prlctl = var.parallels_prlctl == null ? (
var.is_windows ? [
["set", "{{ .Name }}", "--efi-boot", "off"]
] : [
["set", "{{ .Name }}", "--3d-accelerate", "off"],
["set", "{{ .Name }}", "--videosize", "16"]
]
["set", "{{ .Name }}", "--efi-boot", "off"],
["set", "{{ .Name }}", "--efi-secure-boot", "off"],
["set", "{{ .Name }}", "--device-add", "cdrom", "--image", "${path.root}/../builds/iso/unattended.iso", "--connect"],
] : null
) : var.parallels_prlctl

# qemu
Expand All @@ -35,7 +34,7 @@ locals {
) : var.qemu_machine_type
qemuargs = var.qemuargs == null ? (
var.is_windows ? [
["-drive", "file=${path.root}/win_answer_files/virtio-win.iso,media=cdrom,index=3"],
["-drive", "file=${path.root}/../builds/iso/virtio-win.iso,media=cdrom,index=3"],
["-drive", "file=${path.root}/../builds/packer-${var.os_name}-${var.os_version}-${var.os_arch}-qemu/{{ .Name }},if=virtio,cache=writeback,discard=ignore,format=qcow2,index=1"],
] : (
var.os_arch == "aarch64" ? [
Expand Down Expand Up @@ -76,22 +75,26 @@ locals {
var.is_windows ? (
var.hyperv_generation == 2 ? [
"${path.root}/win_answer_files/${var.os_version}/hyperv-gen2/Autounattend.xml",
] : [
"${path.root}/win_answer_files/${var.os_version}/Autounattend.xml",
]
] : (
var.os_arch == "x86_64" ? [
"${path.root}/win_answer_files/${var.os_version}/Autounattend.xml",
] : [
"${path.root}/win_answer_files/${var.os_version}/arm64/Autounattend.xml",
]
)
) : null
) : var.cd_files
communicator = var.communicator == null ? (
var.is_windows ? "winrm" : "ssh"
) : var.communicator
floppy_files = var.floppy_files == null ? (
var.is_windows ? [
"${path.root}/win_answer_files/${var.os_version}/Autounattend.xml",
] : (
var.os_name == "springdalelinux" ? [
"${path.root}/http/rhel/${substr(var.os_version, 0, 1)}ks.cfg"
] : null
)
var.is_windows ? (
var.os_arch == "x86_64" ? [
"${path.root}/win_answer_files/${var.os_version}/Autounattend.xml",
] : [
"${path.root}/win_answer_files/${var.os_version}/arm64/Autounattend.xml",
]
) : null
) : var.floppy_files
http_directory = var.http_directory == null ? "${path.root}/http" : var.http_directory
memory = var.memory == null ? (var.is_windows ? 4096 : 2048) : var.memory
Expand Down Expand Up @@ -203,6 +206,7 @@ source "qemu" "vm" {
}
source "virtualbox-iso" "vm" {
# Virtualbox specific options
#firmware = "efi"
gfx_controller = local.vbox_gfx_controller
gfx_vram_size = local.vbox_gfx_vram_size
guest_additions_path = var.vbox_guest_additions_path
Expand Down
1 change: 1 addition & 0 deletions packer_templates/pkr-variables.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ variable "vmware_version" {
variable "vmware_vmx_data" {
type = map(string)
default = {
# "firmware" = "efi"
"cpuid.coresPerSocket" = "2"
"ethernet0.pciSlotNumber" = "32"
"svga.autodetect" = true
Expand Down
2 changes: 1 addition & 1 deletion packer_templates/win_answer_files/10/Autounattend.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
</ProductKey>
<AcceptEula>true</AcceptEula>
<FullName>Vagrant</FullName>
<Organization>Bento by Chef Software, Inc.</Organization>
<Organization>Bento by Progress Chef</Organization>
</UserData>
<DynamicUpdate>
<Enable>false</Enable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
</ProductKey>
<AcceptEula>true</AcceptEula>
<FullName>Vagrant</FullName>
<Organization>Bento by Chef Software, Inc.</Organization>
<Organization>Bento by Progress Chef</Organization>
</UserData>
<DynamicUpdate>
<Enable>false</Enable>
Expand Down
2 changes: 1 addition & 1 deletion packer_templates/win_answer_files/11/Autounattend.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
</ProductKey>
<AcceptEula>true</AcceptEula>
<FullName>Vagrant</FullName>
<Organization>Bento by Chef Software, Inc.</Organization>
<Organization>Bento by Progress Chef.</Organization>
</UserData>
<DynamicUpdate>
<Enable>false</Enable>
Expand Down
Loading

0 comments on commit 3094137

Please sign in to comment.