Skip to content

Commit ec5b52d

Browse files
Merge pull request #21 from ccdc-opensource/ubuntu-24
Add Ubuntu 24 spec (NO_JIRA)
2 parents eeb3692 + 67f8510 commit ec5b52d

File tree

2 files changed

+36
-26
lines changed

2 files changed

+36
-26
lines changed

ubuntu.hcl ubuntu.pkr.hcl

+26-26
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ packer {
2222

2323
variable "vagrant_box" { type = string }
2424
variable "output_directory" { type = string }
25+
variable "iso_url" { type = string }
26+
variable "iso_checksum" { type = string }
2527

2628
// Ansible provisioning settings
2729
variable "artifactory_api_key" {
@@ -42,13 +44,13 @@ variable "user_username" {
4244
}
4345

4446
// Basic hardware specs
45-
variable "cpu_count" {
47+
variable "cpus" {
4648
type = number
4749
default = "2"
4850
}
49-
variable "ram_gb" {
51+
variable "ram_mb" {
5052
type = number
51-
default = "4"
53+
default = 4096
5254
}
5355
variable "disk_size" {
5456
type = string
@@ -130,10 +132,10 @@ source "hyperv-iso" "ubuntu" {
130132
disk_size = "${var.disk_size}"
131133
enable_secure_boot = false
132134
generation = "${var.hyperv_generation}"
133-
http_directory = "${local.http_directory}"
134-
iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
135-
iso_url = "${var.mirror}/${var.mirror_directory}/${var.iso_name}"
136-
memory = "${var.memory}"
135+
http_directory = "./http"
136+
iso_checksum = "${var.iso_checksum}"
137+
iso_url = "${var.iso_url}"
138+
ram_gb = "${var.ram_mb} / 1024"
137139
output_directory = "${var.build_directory}/packer-${var.template}-hyperv"
138140
shutdown_command = "echo 'vagrant' | sudo -S shutdown -P now"
139141
ssh_password = "vagrant"
@@ -149,16 +151,14 @@ source "virtualbox-iso" "ubuntu" {
149151
boot_wait = "4s"
150152
cpus = "${var.cpus}"
151153
disk_size = "${var.disk_size}"
152-
guest_additions_path = "VBoxGuestAdditions_{{ .Version }}.iso"
153-
guest_additions_url = "${var.guest_additions_url}"
154154
guest_os_type = "Ubuntu_64"
155155
hard_drive_interface = "sata"
156156
headless = "${var.headless}"
157-
http_directory = "${local.http_directory}"
158-
iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
159-
iso_url = "${var.mirror}/${var.mirror_directory}/${var.iso_name}"
160-
memory = "${var.memory}"
161-
output_directory = "${var.build_directory}/packer-${var.template}-virtualbox"
157+
http_directory = "./http"
158+
iso_checksum = "${var.iso_checksum}"
159+
iso_url = "${var.iso_url}"
160+
memory = "${var.ram_mb}"
161+
output_directory = "${var.output_directory}/virtualbox"
162162
shutdown_command = "echo 'vagrant' | sudo -S shutdown -P now"
163163
ssh_handshake_attempts = 20
164164
ssh_password = "vagrant"
@@ -167,7 +167,7 @@ source "virtualbox-iso" "ubuntu" {
167167
ssh_username = "vagrant"
168168
vboxmanage = [["modifyvm", "{{ .Name }}", "--clipboard-mode", "bidirectional"], ["modifyvm", "{{ .Name }}", "--graphicscontroller", "vmsvga"], ["modifyvm", "{{ .Name }}", "--accelerate3d", "on"], ["storageattach", "{{ .Name }}", "--storagectl", "SATA Controller", "--port", "1", "--device", "0", "--type", "dvddrive", "--medium", "emptydrive"]]
169169
virtualbox_version_file = ".vbox_version"
170-
vm_name = "${var.template}"
170+
vm_name = "${var.vagrant_box}"
171171
}
172172

173173
source "vmware-iso" "ubuntu" {
@@ -177,19 +177,19 @@ source "vmware-iso" "ubuntu" {
177177
disk_size = "${var.disk_size}"
178178
guest_os_type = "ubuntu-64"
179179
headless = "${var.headless}"
180-
http_directory = "${local.http_directory}"
181-
iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
182-
iso_url = "${var.mirror}/${var.mirror_directory}/${var.iso_name}"
183-
memory = "${var.memory}"
180+
http_directory = "./http"
181+
iso_checksum = "${var.iso_checksum}"
182+
iso_url = "${var.iso_url}"
183+
memory = "${var.ram_mb}"
184184
network_adapter_type = "VMXNET3"
185-
output_directory = "${var.build_directory}/packer-${var.template}-vmware"
185+
output_directory = "${var.output_directory}/vmware"
186186
shutdown_command = "echo 'vagrant' | sudo -S shutdown -P now"
187187
ssh_password = "vagrant"
188188
ssh_port = 22
189189
ssh_timeout = "1h"
190190
ssh_username = "vagrant"
191191
tools_upload_flavor = ""
192-
vm_name = "${var.template}"
192+
vm_name = "${var.vagrant_box}"
193193
vmx_data = {
194194
"cpuid.coresPerSocket" = "1"
195195
"disk.EnableUUID" = "TRUE"
@@ -219,10 +219,10 @@ source "vsphere-iso" "ubuntu" {
219219
disk_thin_provisioned = true
220220
}
221221
guest_os_type = "ubuntu64Guest"
222-
http_directory = "${local.http_directory}"
223-
iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum}"
224-
iso_url = "${var.mirror}/${var.mirror_directory}/${var.iso_name}"
225-
RAM = "${var.memory}"
222+
http_directory = "./http"
223+
iso_checksum = "${var.iso_checksum}"
224+
iso_url = "${var.iso_url}"
225+
memory = "${var.ram_mb}"
226226
shutdown_command = "echo 'vagrant' | sudo -S /sbin/halt -h -p"
227227
ssh_password = "vagrant"
228228
ssh_port = 22
@@ -240,7 +240,7 @@ source "vsphere-iso" "ubuntu" {
240240
# https://www.packer.io/docs/templates/hcl_templates/blocks/build
241241
build {
242242
sources = [
243-
"source.hyperv-iso.ubuntu",
243+
// "source.hyperv-iso.ubuntu",
244244
"source.virtualbox-iso.ubuntu",
245245
"source.vmware-iso.ubuntu",
246246
"source.vsphere-iso.ubuntu"

ubuntu24.pkrvars.hcl

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// vmware settings
2+
vmware_guest_os_type = "ubuntu-64"
3+
vsphere_guest_os_type = "ubuntu64Guest"
4+
vsphere_name = "ccdc-basebox-ubuntu-24.04"
5+
6+
output_directory = "output/ubuntu-24.04/"
7+
iso_url = "https://releases.ubuntu.com/noble/ubuntu-24.04.1-live-server-amd64.iso"
8+
iso_checksum = "sha256:e240e4b801f7bb68c20d1356b60968ad0c33a41d00d828e74ceb3364a0317be9"
9+
box_basename = "ubuntu-24.04"
10+
vagrant_box = "ccdc-basebox/ubuntu-24.04"

0 commit comments

Comments
 (0)