diff --git a/CHANGELOG.md b/CHANGELOG.md index f87c638ef..d1f1f3d81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,10 @@ [#895](https://github.com/vmware-samples/packer-examples-for-vsphere/pull/895) - Adds option to enable cloud-init on Rocky Linux 8. [#895](https://github.com/vmware-samples/packer-examples-for-vsphere/pull/895) +- Adds option to enable cloud-init on CentOS Stream 8. + [#897](https://github.com/vmware-samples/packer-examples-for-vsphere/pull/897) +- Adds option to enable cloud-init on CentOS Stream 9. + [#897](https://github.com/vmware-samples/packer-examples-for-vsphere/pull/897) **Chore**: diff --git a/builds/linux/centos/8-stream/linux-centos-stream.pkr.hcl b/builds/linux/centos/8-stream/linux-centos-stream.pkr.hcl index c8d5991a4..9a55a078b 100644 --- a/builds/linux/centos/8-stream/linux-centos-stream.pkr.hcl +++ b/builds/linux/centos/8-stream/linux-centos-stream.pkr.hcl @@ -56,6 +56,7 @@ locals { vm_guest_os_language = var.vm_guest_os_language vm_guest_os_keyboard = var.vm_guest_os_keyboard vm_guest_os_timezone = var.vm_guest_os_timezone + vm_guest_os_cloudinit = var.vm_guest_os_cloudinit network = templatefile("${abspath(path.root)}/data/network.pkrtpl.hcl", { device = var.vm_network_device ip = var.vm_ip_address @@ -211,6 +212,7 @@ build { "--extra-vars", "build_key='${var.build_key}'", "--extra-vars", "ansible_username=${var.ansible_username}", "--extra-vars", "ansible_key='${var.ansible_key}'", + "--extra-vars", "enable_cloudinit=${var.vm_guest_os_cloudinit}", ] } diff --git a/builds/linux/centos/8-stream/linux-centos-stream.pkrvars.hcl.example b/builds/linux/centos/8-stream/linux-centos-stream.pkrvars.hcl.example index 2e4c4c2f4..a9c200bf9 100644 --- a/builds/linux/centos/8-stream/linux-centos-stream.pkrvars.hcl.example +++ b/builds/linux/centos/8-stream/linux-centos-stream.pkrvars.hcl.example @@ -16,6 +16,7 @@ vm_guest_os_version = "8" // Virtual Machine Guest Operating System Setting vm_guest_os_type = "centos8_64Guest" +vm_guest_os_cloudinit = false // Virtual Machine Hardware Settings vm_firmware = "efi-secure" diff --git a/builds/linux/centos/8-stream/variables.pkr.hcl b/builds/linux/centos/8-stream/variables.pkr.hcl index e463e2d4a..104ae5f89 100644 --- a/builds/linux/centos/8-stream/variables.pkr.hcl +++ b/builds/linux/centos/8-stream/variables.pkr.hcl @@ -121,6 +121,12 @@ variable "vm_guest_os_type" { description = "The guest operating system type, also know as guestid." } +variable "vm_guest_os_cloudinit" { + type = bool + description = "Enable cloud-init for the guest operating system." + default = false +} + variable "vm_firmware" { type = string description = "The virtual machine firmware." diff --git a/builds/linux/centos/9-stream/linux-centos-stream.pkr.hcl b/builds/linux/centos/9-stream/linux-centos-stream.pkr.hcl index 1691fc122..206565e43 100644 --- a/builds/linux/centos/9-stream/linux-centos-stream.pkr.hcl +++ b/builds/linux/centos/9-stream/linux-centos-stream.pkr.hcl @@ -56,6 +56,7 @@ locals { vm_guest_os_language = var.vm_guest_os_language vm_guest_os_keyboard = var.vm_guest_os_keyboard vm_guest_os_timezone = var.vm_guest_os_timezone + vm_guest_os_cloudinit = var.vm_guest_os_cloudinit network = templatefile("${abspath(path.root)}/data/network.pkrtpl.hcl", { device = var.vm_network_device ip = var.vm_ip_address @@ -212,6 +213,7 @@ build { "--extra-vars", "build_key='${var.build_key}'", "--extra-vars", "ansible_username=${var.ansible_username}", "--extra-vars", "ansible_key='${var.ansible_key}'", + "--extra-vars", "enable_cloudinit=${var.vm_guest_os_cloudinit}", ] } diff --git a/builds/linux/centos/9-stream/linux-centos-stream.pkrvars.hcl.example b/builds/linux/centos/9-stream/linux-centos-stream.pkrvars.hcl.example index c55b65ef9..5c76308ca 100644 --- a/builds/linux/centos/9-stream/linux-centos-stream.pkrvars.hcl.example +++ b/builds/linux/centos/9-stream/linux-centos-stream.pkrvars.hcl.example @@ -16,6 +16,7 @@ vm_guest_os_version = "9" // Virtual Machine Guest Operating System Setting vm_guest_os_type = "other5xLinux64Guest" +vm_guest_os_cloudinit = false // Virtual Machine Hardware Settings vm_firmware = "efi-secure" diff --git a/builds/linux/centos/9-stream/variables.pkr.hcl b/builds/linux/centos/9-stream/variables.pkr.hcl index aed9716f3..259224e2b 100644 --- a/builds/linux/centos/9-stream/variables.pkr.hcl +++ b/builds/linux/centos/9-stream/variables.pkr.hcl @@ -121,6 +121,12 @@ variable "vm_guest_os_type" { description = "The guest operating system type, also know as guestid." } +variable "vm_guest_os_cloudinit" { + type = bool + description = "Enable cloud-init for the guest operating system." + default = false +} + variable "vm_firmware" { type = string description = "The virtual machine firmware." diff --git a/docs/index.md b/docs/index.md index 3537eb6fe..a5845391a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -33,8 +33,8 @@ This project supports the following guest operating systems: | | 8 | :octicons-check-circle-24:{ .green } | :octicons-x-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | | :simple-oracle:    Oracle Linux @span | 9 | :octicons-check-circle-24:{ .green } | :octicons-x-circle-24: | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | | | 8 | :octicons-check-circle-24:{ .green } | :octicons-x-circle-24: | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | -| :fontawesome-brands-centos:    CentOS @span | 9 Stream | :octicons-check-circle-24:{ .green } | :octicons-x-circle-24: | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | -| | 8 Stream | :octicons-check-circle-24:{ .green } | :octicons-x-circle-24: | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | +| :fontawesome-brands-centos:    CentOS @span | 9 Stream | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | +| | 8 Stream | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | | | 7 | :octicons-check-circle-24:{ .green } | :octicons-x-circle-24: | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | | :fontawesome-brands-suse:    SUSE Linux Enterprise @span | 15 | :octicons-check-circle-24:{ .green } | :octicons-x-circle-24: | :octicons-x-circle-24: | :octicons-x-circle-24: | ::end-spantable:: diff --git a/project.json b/project.json index 3076640ed..7faac6f8a 100644 --- a/project.json +++ b/project.json @@ -298,7 +298,7 @@ "architectures": [ { "architecture": "amd64", - "download_link": "https://mirror.rackspace.com/CentOS/8-stream/isos/x86_64/CentOS-Stream-8-20240408.0-x86_64-dvd1.iso", + "download_link": "https://mirror.rackspace.com/CentOS/8-stream/isos/x86_64/CentOS-Stream-8-x86_64-latest-dvd1.iso", "checksum_algorithm": "sha256", "checksum": "https://mirror.rackspace.com/CentOS/8-stream/isos/x86_64/CHECKSUM" }