From fbb2fb15ce0c5ae394adb150ab7a3814c5d4cb86 Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Fri, 19 Apr 2024 18:39:31 -0400 Subject: [PATCH] feat: add fedora server Adds Fedora Server Linux distribution. Ref: #885 Signed-off-by: Ryan Johnson --- .gitlab-ci.yml | 9 + .vscode/settings.json | 2 +- CHANGELOG.md | 6 +- README.md | 1 + ansible/roles/base/tasks/linux.yml | 27 +- ansible/roles/configure/tasks/redhat.yml | 4 +- build.sh | 101 ++-- build.yaml | 6 + builds/linux/fedora/39/data/ks.pkrtpl.hcl | 81 ++++ .../linux/fedora/39/data/network.pkrtpl.hcl | 5 + .../linux/fedora/39/data/storage.pkrtpl.hcl | 73 +++ builds/linux/fedora/39/linux-fedora.pkr.hcl | 265 +++++++++++ .../39/linux-fedora.pkrvars.hcl.example | 46 ++ .../linux/fedora/39/variables-network.pkr.hcl | 40 ++ .../linux/fedora/39/variables-storage.pkr.hcl | 57 +++ builds/linux/fedora/39/variables.pkr.hcl | 439 ++++++++++++++++++ builds/linux/rhel/9/data/ks.pkrtpl.hcl | 2 +- docs/getting-started/iso.md | 80 ++-- docs/index.md | 5 +- download.sh | 7 +- project.json | 27 +- 21 files changed, 1190 insertions(+), 93 deletions(-) create mode 100644 builds/linux/fedora/39/data/ks.pkrtpl.hcl create mode 100644 builds/linux/fedora/39/data/network.pkrtpl.hcl create mode 100644 builds/linux/fedora/39/data/storage.pkrtpl.hcl create mode 100644 builds/linux/fedora/39/linux-fedora.pkr.hcl create mode 100644 builds/linux/fedora/39/linux-fedora.pkrvars.hcl.example create mode 100644 builds/linux/fedora/39/variables-network.pkr.hcl create mode 100644 builds/linux/fedora/39/variables-storage.pkr.hcl create mode 100644 builds/linux/fedora/39/variables.pkr.hcl diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4711552d4..c122f0824 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -210,6 +210,15 @@ CentOS-Linux-7: ############################################################################## +Fedora-Server-40: + extends: .packer-build + variables: + INPUT_PATH: "$SCRIPT_PATH/builds/linux/fedora/39/" + BUILD_VARS: "linux-fedora-39.pkrvars.hcl" + EXTRA_VAR_FILES: "-var-file=$CONFIG_PATH/network.pkrvars.hcl -var-file=$CONFIG_PATH/linux-storage.pkrvars.hcl" + +############################################################################## + SUSE-Linux-Enterprise-Server-15: extends: .packer-build variables: diff --git a/.vscode/settings.json b/.vscode/settings.json index ea09b4560..81add3d8e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -42,7 +42,7 @@ "[md]": { "editor.defaultFormatter": "DavidAnson.vscode-markdownlint", "editor.formatOnPaste": true, - "editor.formatOnSave": true, + "editor.formatOnSave": false, "editor.formatOnType": true, "editor.trimAutoWhitespace": true, "editor.wordWrap": "bounded", diff --git a/CHANGELOG.md b/CHANGELOG.md index 05fd43b3b..e767c4d72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,14 @@ **Enhancement**: -- Adds Ubuntu Server 24.04 LTS to the project. - [#891](https://github.com/vmware-samples/packer-examples-for-vsphere/pull/891) - Adds a script (`./download.sh`) and a configuration (`project.json`) to assist in the download of the guest operating systems. [#874](https://github.com/vmware-samples/packer-examples-for-vsphere/pull/874), [#877](https://github.com/vmware-samples/packer-examples-for-vsphere/pull/877) +- Adds Ubuntu Server 24.04 LTS to the project. + [#891](https://github.com/vmware-samples/packer-examples-for-vsphere/pull/891) +- Adds Fedora Server 40 Linux distribution to the project. + [#xxx](https://github.com/vmware-samples/packer-examples-for-vsphere/pull/xxx) - Adds option to enable cloud-init on Debian 12. [#883](https://github.com/vmware-samples/packer-examples-for-vsphere/pull/883) - Adds option to enable cloud-init on Red Hat Enterprise Linux 9. diff --git a/README.md b/README.md index d8c1cc9f7..18c8480aa 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ This project supports the following guest operating systems: | CentOS Stream | 9 | | CentOS Stream | 8 | | CentOS Linux | 7 | +| Fedora Server | 39 | | SUSE Linux Enterprise Server | 15 | ## Microsoft Windows diff --git a/ansible/roles/base/tasks/linux.yml b/ansible/roles/base/tasks/linux.yml index 1a4f8394d..19a597370 100644 --- a/ansible/roles/base/tasks/linux.yml +++ b/ansible/roles/base/tasks/linux.yml @@ -70,35 +70,38 @@ - block: - name: "Updating the operating system." - yum: + dnf: name: "*" state: latest # noqa package-latest update_cache: true + - name: "Installing Cloud-init." + dnf: + name: cloud-init + state: latest + when: enable_cloudinit == 'true' + - name: "Installing additional packages." - yum: + dnf: name: "{{ additional_packages[ansible_os_family] }}" state: latest # noqa package-latest - when: ansible_os_family == 'RedHat' and ansible_distribution_major_version | int < 8 + when: + - ansible_distribution == 'Fedora' and ansible_distribution_major_version | int >= 40 + - ansible_os_family == 'RedHat' and ansible_distribution_major_version | int >= 8 - block: - name: "Updating the operating system." - dnf: + yum: name: "*" state: latest # noqa package-latest update_cache: true - - name: "Installing Cloud-init." - dnf: - name: cloud-init - state: latest - when: enable_cloudinit == 'true' - - name: "Installing additional packages." - dnf: + yum: name: "{{ additional_packages[ansible_os_family] }}" state: latest # noqa package-latest - when: ansible_os_family == 'RedHat' and ansible_distribution_major_version | int >= 8 + when: ansible_os_family == 'RedHat' and ansible_distribution_major_version | int < 8 + # SUSE Linux Enterprise Server diff --git a/ansible/roles/configure/tasks/redhat.yml b/ansible/roles/configure/tasks/redhat.yml index d78d42b35..fae089246 100644 --- a/ansible/roles/configure/tasks/redhat.yml +++ b/ansible/roles/configure/tasks/redhat.yml @@ -6,7 +6,7 @@ when: ansible_distribution == 'RedHat' # Tasks for configuring SSH for public key authentication. -- name: "Configuring SSH for Public Key Authentication." +- name: "Configuring SSH for Public Key Authentication without cloud-init." block: - lineinfile: path: /etc/ssh/sshd_config @@ -17,6 +17,8 @@ regexp: '^PubkeyAuthentication' line: 'PubkeyAuthentication yes' when: enable_cloudinit == 'false' + +- name: "Configuring SSH for Public Key Authentication without cloud-init." block: - lineinfile: path: /etc/ssh/sshd_config diff --git a/build.sh b/build.sh index 8b85e9f5d..4d0b713bc 100755 --- a/build.sh +++ b/build.sh @@ -762,6 +762,43 @@ menu_option_19() { } menu_option_20() { + INPUT_PATH="$SCRIPT_PATH"/builds/linux/fedora/39/ + BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} + BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" + + echo -e "\nCONFIRM: Build a Fedora Server 40 Template for VMware vSphere?" + echo -e "\nContinue? (y/n)" + read -r REPLY + if [[ ! $REPLY =~ ^[Yy]$ ]]; then + exit 1 + fi + + ### Build a Fedora Server 40 Template for VMware vSphere. ### + echo "Building a Fedora Server 40 Template for VMware vSphere..." + + ### Initialize HashiCorp Packer and required plugins. ### + echo "Initializing HashiCorp Packer and required plugins..." + packer init "$INPUT_PATH" + + ### Start the Build. ### + echo "Starting the build...." + echo "packer build -force -on-error=ask $debug_option" + packer build -force -on-error=ask $debug_option \ + -var-file="$CONFIG_PATH/vsphere.pkrvars.hcl" \ + -var-file="$CONFIG_PATH/build.pkrvars.hcl" \ + -var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \ + -var-file="$CONFIG_PATH/proxy.pkrvars.hcl" \ + -var-file="$CONFIG_PATH/common.pkrvars.hcl" \ + -var-file="$CONFIG_PATH/network.pkrvars.hcl" \ + -var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \ + -var-file="$CONFIG_PATH/$BUILD_VARS" \ + "$INPUT_PATH" + + ### Build Complete. ### + echo "Build Complete." +} + +menu_option_21() { INPUT_PATH="$SCRIPT_PATH"/builds/linux/sles/15/ BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" @@ -798,7 +835,7 @@ menu_option_20() { } -menu_option_21() { +menu_option_22() { INPUT_PATH="$SCRIPT_PATH"/builds/windows/server/2025/ BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" @@ -833,7 +870,7 @@ menu_option_21() { echo "Build Complete." } -menu_option_22() { +menu_option_23() { INPUT_PATH="$SCRIPT_PATH"/builds/windows/server/2025/ BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" @@ -869,7 +906,7 @@ menu_option_22() { echo "Build Complete." } -menu_option_23() { +menu_option_24() { INPUT_PATH="$SCRIPT_PATH"/builds/windows/server/2025/ BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" @@ -905,7 +942,7 @@ menu_option_23() { echo "Build Complete." } -menu_option_24() { +menu_option_25() { INPUT_PATH="$SCRIPT_PATH"/builds/windows/server/2022/ BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" @@ -940,7 +977,7 @@ menu_option_24() { echo "Build Complete." } -menu_option_25() { +menu_option_26() { INPUT_PATH="$SCRIPT_PATH"/builds/windows/server/2022/ BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" @@ -976,7 +1013,7 @@ menu_option_25() { echo "Build Complete." } -menu_option_26() { +menu_option_27() { INPUT_PATH="$SCRIPT_PATH"/builds/windows/server/2022/ BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" @@ -1012,7 +1049,7 @@ menu_option_26() { echo "Build Complete." } -menu_option_27() { +menu_option_28() { INPUT_PATH="$SCRIPT_PATH"/builds/windows/server/2019/ BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" @@ -1047,7 +1084,7 @@ menu_option_27() { echo "Build Complete." } -menu_option_28() { +menu_option_29() { INPUT_PATH="$SCRIPT_PATH"/builds/windows/server/2019/ BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" @@ -1083,7 +1120,7 @@ menu_option_28() { echo "Build Complete." } -menu_option_29() { +menu_option_30() { INPUT_PATH="$SCRIPT_PATH"/builds/windows/server/2019/ BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" @@ -1119,7 +1156,7 @@ menu_option_29() { echo "Build Complete." } -menu_option_30() { +menu_option_31() { INPUT_PATH="$SCRIPT_PATH"/builds/windows/desktop/11/ BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" @@ -1154,7 +1191,7 @@ menu_option_30() { echo "Build Complete." } -menu_option_31() { +menu_option_32() { INPUT_PATH="$SCRIPT_PATH"/builds/windows/desktop/11/ BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" @@ -1190,7 +1227,7 @@ menu_option_31() { echo "Build Complete." } -menu_option_32() { +menu_option_33() { INPUT_PATH="$SCRIPT_PATH"/builds/windows/desktop/11/ BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" @@ -1226,7 +1263,7 @@ menu_option_32() { echo "Build Complete." } -menu_option_33() { +menu_option_34() { INPUT_PATH="$SCRIPT_PATH"/builds/windows/desktop/10/ BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" @@ -1261,7 +1298,7 @@ menu_option_33() { echo "Build Complete." } -menu_option_34() { +menu_option_35() { INPUT_PATH="$SCRIPT_PATH"/builds/windows/desktop/10/ BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" @@ -1297,7 +1334,7 @@ menu_option_34() { echo "Build Complete." } -menu_option_35() { +menu_option_36() { INPUT_PATH="$SCRIPT_PATH"/builds/windows/desktop/10/ BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" @@ -1378,25 +1415,26 @@ until [ "$selection" = "0" ]; do echo " 17 - CentOS Stream 9" echo " 18 - CentOS Stream 8" echo " 19 - CentOS Linux 7" - echo " 20 - SUSE Linux Enterprise Server 15" + echo " 20 - Fedora Server 40" + echo " 21 - SUSE Linux Enterprise Server 15" echo "" echo " Microsoft Windows:" echo "" - echo " 21 - Windows Server 2025 - All" - echo " 22 - Windows Server 2025 - Standard Only" - echo " 23 - Windows Server 2025 - Datacenter Only" - echo " 24 - Windows Server 2022 - All" - echo " 25 - Windows Server 2022 - Standard Only" - echo " 26 - Windows Server 2022 - Datacenter Only" - echo " 27 - Windows Server 2019 - All" - echo " 28 - Windows Server 2019 - Standard Only" - echo " 29 - Windows Server 2019 - Datacenter Only" - echo " 30 - Windows 11 - All" - echo " 31 - Windows 11 - Enterprise Only" - echo " 32 - Windows 11 - Professional Only" - echo " 33 - Windows 10 - All" - echo " 34 - Windows 10 - Enterprise Only" - echo " 35 - Windows 10 - Professional Only" + echo " 22 - Windows Server 2025 - All" + echo " 23 - Windows Server 2025 - Standard Only" + echo " 24 - Windows Server 2025 - Datacenter Only" + echo " 25 - Windows Server 2022 - All" + echo " 26 - Windows Server 2022 - Standard Only" + echo " 27 - Windows Server 2022 - Datacenter Only" + echo " 28 - Windows Server 2019 - All" + echo " 29 - Windows Server 2019 - Standard Only" + echo " 30 - Windows Server 2019 - Datacenter Only" + echo " 31 - Windows 11 - All" + echo " 32 - Windows 11 - Enterprise Only" + echo " 33 - Windows 11 - Professional Only" + echo " 34 - Windows 10 - All" + echo " 35 - Windows 10 - Enterprise Only" + echo " 36 - Windows 10 - Professional Only" echo "" echo " Other:" echo "" @@ -1441,6 +1479,7 @@ until [ "$selection" = "0" ]; do 33 ) clear ; menu_option_33 ; press_enter ;; 34 ) clear ; menu_option_34 ; press_enter ;; 35 ) clear ; menu_option_35 ; press_enter ;; + 36 ) clear ; menu_option_36 ; press_enter ;; i|I ) clear ; info ; press_enter ;; q|Q ) clear ; exit ;; * ) clear ; incorrect_selection ; press_enter ;; diff --git a/build.yaml b/build.yaml index a275e139e..6f04a3398 100644 --- a/build.yaml +++ b/build.yaml @@ -124,6 +124,12 @@ menu: var_files: - "network.pkrvars.hcl" - "linux-storage.pkrvars.hcl" + - entry: "Fedora Server 40" + build: + path: "builds/linux/fedora/39/" + var_files: + - "network.pkrvars.hcl" + - "linux-storage.pkrvars.hcl" - entry: "SUSE Linux Enterprise Server 15" build: path: "builds/linux/sles/15/" diff --git a/builds/linux/fedora/39/data/ks.pkrtpl.hcl b/builds/linux/fedora/39/data/ks.pkrtpl.hcl new file mode 100644 index 000000000..ec8529adc --- /dev/null +++ b/builds/linux/fedora/39/data/ks.pkrtpl.hcl @@ -0,0 +1,81 @@ +# Copyright 2023-2024 Broadcom. All rights reserved. +# SPDX-License-Identifier: BSD-2 + +# Fedora Server 40 + +### Installs from the first attached CD-ROM/DVD on the system. +cdrom + +### Performs the kickstart installation in text mode. +### By default, kickstart installations are performed in graphical mode. +text + +### Accepts the End User License Agreement. +eula --agreed + +### Sets the language to use during installation and the default language to use on the installed system. +lang ${vm_guest_os_language} + +### Sets the default keyboard type for the system. +keyboard ${vm_guest_os_keyboard} + +### Configure network information for target system and activate network devices in the installer environment (optional) +### --onboot enable device at a boot time +### --device device to be activated and / or configured with the network command +### --bootproto method to obtain networking configuration for device (default dhcp) +### --noipv6 disable IPv6 on this device +${network} + +### Lock the root account. +rootpw --lock + +### The selected profile will restrict root login. +### Add a user that can login and escalate privileges. +user --name=${build_username} --iscrypted --password=${build_password_encrypted} --groups=wheel + +### Configure firewall settings for the system. +### --enabled reject incoming connections that are not in response to outbound requests +### --ssh allow sshd service through the firewall +firewall --enabled --ssh + +### Sets up the authentication options for the system. +### The SSDD profile sets sha512 to hash passwords. Passwords are shadowed by default +### See the manual page for authselect-profile for a complete list of possible options. +authselect select sssd + +### Sets the state of SELinux on the installed system. +### Defaults to enforcing. +selinux --enforcing + +### Sets the system time zone. +timezone ${vm_guest_os_timezone} + +### Partitioning +${storage} + +### Modifies the default set of services that will run under the default runlevel. +services --enabled=NetworkManager,sshd + +### Do not configure X on the installed system. +skipx + +### Packages selection. +%packages --ignoremissing --excludedocs +@core +-iwl*firmware +%end + +### Post-installation commands. +%post +dnf makecache +dnf install -y sudo open-vm-tools perl python3-libselinux +%{ if additional_packages != "" ~} +dnf install -y ${additional_packages} +%{ endif ~} +echo "${build_username} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/${build_username} +sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers +%end + +### Reboot after the installation is complete. +### --eject attempt to eject the media before rebooting. +reboot --eject diff --git a/builds/linux/fedora/39/data/network.pkrtpl.hcl b/builds/linux/fedora/39/data/network.pkrtpl.hcl new file mode 100644 index 000000000..64aaf4f8b --- /dev/null +++ b/builds/linux/fedora/39/data/network.pkrtpl.hcl @@ -0,0 +1,5 @@ +%{ if ip != null ~} +network --device=${device} --bootproto=static --ip=${ip} --netmask=${cidrnetmask("${ip}/${netmask}")} --gateway=${gateway} --nameserver=${join(",", dns)} +%{ else ~} +network --device=${device} --bootproto=dhcp +%{ endif ~} \ No newline at end of file diff --git a/builds/linux/fedora/39/data/storage.pkrtpl.hcl b/builds/linux/fedora/39/data/storage.pkrtpl.hcl new file mode 100644 index 000000000..b35af8998 --- /dev/null +++ b/builds/linux/fedora/39/data/storage.pkrtpl.hcl @@ -0,0 +1,73 @@ +### Sets how the boot loader should be installed. +bootloader --location=mbr + +### Initialize any invalid partition tables found on disks. +zerombr + +### Removes partitions from the system, prior to creation of new partitions. +### By default, no partitions are removed. +### --all Erases all partitions from the system +### --initlabel Initializes a disk (or disks) by creating a default disk label for all disks in their respective architecture. +clearpart --all --initlabel + +### Modify partition sizes for the virtual machine hardware. +### Create primary system partitions. +%{ for partition in partitions ~} +part +%{~ if partition.volume_group != "" ~} + pv.${partition.volume_group} +%{~ else ~} +%{~ if partition.format.fstype == "swap" ~} + swap +%{~ else ~} + ${partition.mount.path} +%{~ endif ~} +%{~ if partition.format.fstype != "" ~} + --label=${partition.format.label} +%{~ if partition.format.fstype == "fat32" ~} + --fstype vfat +%{~ else ~} + --fstype ${partition.format.fstype} +%{~ endif ~} +%{~ endif ~} +%{~ endif ~} +%{~ if partition.mount.options != "" ~} + --fsoptions="${partition.mount.options}" +%{~ endif ~} +%{~ if partition.size != -1 ~} + --size=${partition.size} +%{~ else ~} + --size=100 --grow +%{ endif ~} + +%{ endfor ~} +### Create a logical volume management (LVM) group. +%{ for index, volume_group in lvm ~} +volgroup sysvg pv.${volume_group.name} + +### Modify logical volume sizes for the virtual machine hardware. +### Create logical volumes. +%{ for partition in volume_group.partitions ~} +logvol +%{~ if partition.format.fstype == "swap" ~} + swap +%{~ else ~} + ${partition.mount.path} +%{~ endif ~} + --name=${partition.name} --vgname=${volume_group.name} --label=${partition.format.label} +%{~ if partition.format.fstype == "fat32" ~} + --fstype vfat +%{~ else ~} + --fstype ${partition.format.fstype} +%{~ endif ~} +%{~ if partition.mount.options != "" ~} + --fsoptions="${partition.mount.options}" +%{~ endif ~} +%{~ if partition.size != -1 ~} + --size=${partition.size} +%{~ else ~} + --size=100 --grow +%{ endif ~} + +%{ endfor ~} +%{ endfor ~} \ No newline at end of file diff --git a/builds/linux/fedora/39/linux-fedora.pkr.hcl b/builds/linux/fedora/39/linux-fedora.pkr.hcl new file mode 100644 index 000000000..1f3300921 --- /dev/null +++ b/builds/linux/fedora/39/linux-fedora.pkr.hcl @@ -0,0 +1,265 @@ +# Copyright 2023-2024 Broadcom. All rights reserved. +# SPDX-License-Identifier: BSD-2 + +/* + DESCRIPTION: + Fedora Server 40 build definition. + Packer Plugin for VMware vSphere: 'vsphere-iso' builder. +*/ + +// BLOCK: packer +// The Packer configuration. + +packer { + required_version = ">= 1.10.0" + required_plugins { + vsphere = { + source = "github.com/hashicorp/vsphere" + version = ">= 1.2.7" + } + ansible = { + source = "github.com/hashicorp/ansible" + version = ">= 1.1.0" + } + git = { + source = "github.com/ethanmdavidson/git" + version = ">= 0.6.2" + } + } +} + +// BLOCK: data +// Defines the data sources. + +data "git-repository" "cwd" {} + +// BLOCK: locals +// Defines the local variables. + +locals { + build_by = "Built by: HashiCorp Packer ${packer.version}" + build_date = formatdate("YYYY-MM-DD hh:mm ZZZ", timestamp()) + build_version = data.git-repository.cwd.head + build_description = "Version: ${local.build_version}\nBuilt on: ${local.build_date}\n${local.build_by}" + iso_paths = { + content_library = "${var.common_iso_content_library}/${var.iso_content_library_item}/${var.iso_file}", + datastore = "[${var.common_iso_datastore}] ${var.iso_datastore_path}/${var.iso_file}" + } + manifest_date = formatdate("YYYY-MM-DD hh:mm:ss", timestamp()) + manifest_path = "${path.cwd}/manifests/" + manifest_output = "${local.manifest_path}${local.manifest_date}.json" + ovf_export_path = "${path.cwd}/artifacts/${local.vm_name}" + data_source_content = { + "/ks.cfg" = templatefile("${abspath(path.root)}/data/ks.pkrtpl.hcl", { + build_username = var.build_username + build_password = var.build_password + build_password_encrypted = var.build_password_encrypted + 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 + netmask = var.vm_ip_netmask + gateway = var.vm_ip_gateway + dns = var.vm_dns_list + }) + storage = templatefile("${abspath(path.root)}/data/storage.pkrtpl.hcl", { + device = var.vm_disk_device + swap = var.vm_disk_use_swap + partitions = var.vm_disk_partitions + lvm = var.vm_disk_lvm + }) + additional_packages = join(" ", var.additional_packages) + }) + } + data_source_command = var.common_data_source == "http" ? "inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg" : "inst.ks=cdrom:/ks.cfg" + vm_name = "${var.vm_guest_os_family}-${var.vm_guest_os_name}-${var.vm_guest_os_version}-${local.build_version}" + bucket_name = replace("${var.vm_guest_os_family}-${var.vm_guest_os_name}-${var.vm_guest_os_version}", ".", "") + bucket_description = "${var.vm_guest_os_family} ${var.vm_guest_os_name} ${var.vm_guest_os_version}" +} + +// BLOCK: source +// Defines the builder configuration blocks. + +source "vsphere-iso" "linux-fedora" { + + // vCenter Server Endpoint Settings and Credentials + vcenter_server = var.vsphere_endpoint + username = var.vsphere_username + password = var.vsphere_password + insecure_connection = var.vsphere_insecure_connection + + // vSphere Settings + datacenter = var.vsphere_datacenter + cluster = var.vsphere_cluster + host = var.vsphere_host + datastore = var.vsphere_datastore + folder = var.vsphere_folder + resource_pool = var.vsphere_resource_pool + set_host_for_datastore_uploads = var.vsphere_set_host_for_datastore_uploads + + // Virtual Machine Settings + vm_name = local.vm_name + guest_os_type = var.vm_guest_os_type + firmware = var.vm_firmware + CPUs = var.vm_cpu_count + cpu_cores = var.vm_cpu_cores + CPU_hot_plug = var.vm_cpu_hot_add + RAM = var.vm_mem_size + RAM_hot_plug = var.vm_mem_hot_add + cdrom_type = var.vm_cdrom_type + disk_controller_type = var.vm_disk_controller_type + storage { + disk_size = var.vm_disk_size + disk_thin_provisioned = var.vm_disk_thin_provisioned + } + network_adapters { + network = var.vsphere_network + network_card = var.vm_network_card + } + vm_version = var.common_vm_version + remove_cdrom = var.common_remove_cdrom + reattach_cdroms = var.vm_cdrom_count + tools_upgrade_policy = var.common_tools_upgrade_policy + notes = local.build_description + + // Removable Media Settings + iso_paths = var.common_iso_content_library_enabled ? [local.iso_paths.content_library] : [local.iso_paths.datastore] + http_content = var.common_data_source == "http" ? local.data_source_content : null + cd_content = var.common_data_source == "disk" ? local.data_source_content : null + + // Boot and Provisioning Settings + http_ip = var.common_data_source == "http" ? var.common_http_ip : null + http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null + http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null + boot_order = var.vm_boot_order + boot_wait = var.vm_boot_wait + boot_command = [ + // This sends the "up arrow" key, typically used to navigate through boot menu options. + "", + // This sends the "e" key. In the GRUB boot loader, this is used to edit the selected boot menu option. + "e", + // This sends two "down arrow" keys, followed by the "end" key, and then waits. This is used to navigate to a specific line in the boot menu option's configuration. + "", + // This types the string "text" followed by the value of the 'data_source_command' local variable. + // This is used to modify the boot menu option's configuration to boot in text mode and specify the kickstart data source configured in the common variables. + "text ${local.data_source_command}", + // This sends the "enter" key, waits, turns on the left control key, sends the "x" key, and then turns off the left control key. This is used to save the changes and exit the boot menu option's configuration, and then continue the boot process. + "x" + ] + ip_wait_timeout = var.common_ip_wait_timeout + ip_settle_timeout = var.common_ip_settle_timeout + shutdown_command = "echo '${var.build_password}' | sudo -S -E shutdown -P now" + shutdown_timeout = var.common_shutdown_timeout + + // Communicator Settings and Credentials + communicator = "ssh" + ssh_proxy_host = var.communicator_proxy_host + ssh_proxy_port = var.communicator_proxy_port + ssh_proxy_username = var.communicator_proxy_username + ssh_proxy_password = var.communicator_proxy_password + ssh_username = var.build_username + ssh_password = var.build_password + ssh_port = var.communicator_port + ssh_timeout = var.communicator_timeout + + // Template and Content Library Settings + convert_to_template = var.common_template_conversion + dynamic "content_library_destination" { + for_each = var.common_content_library_enabled ? [1] : [] + content { + library = var.common_content_library + description = local.build_description + ovf = var.common_content_library_ovf + destroy = var.common_content_library_destroy + skip_import = var.common_content_library_skip_export + } + } + + // OVF Export Settings + dynamic "export" { + for_each = var.common_ovf_export_enabled ? [1] : [] + content { + name = local.vm_name + force = var.common_ovf_export_overwrite + options = [ + "extraconfig" + ] + output_directory = local.ovf_export_path + } + } +} + +// BLOCK: build +// Defines the builders to run, provisioners, and post-processors. + +build { + sources = ["source.vsphere-iso.linux-fedora"] + + provisioner "ansible" { + user = var.build_username + galaxy_file = "${path.cwd}/ansible/linux-requirements.yml" + galaxy_force_with_deps = true + playbook_file = "${path.cwd}/ansible/linux-playbook.yml" + roles_path = "${path.cwd}/ansible/roles" + ansible_env_vars = [ + "ANSIBLE_CONFIG=${path.cwd}/ansible/ansible.cfg", + "ANSIBLE_PYTHON_INTERPRETER=/usr/bin/python3" + ] + extra_arguments = [ + "--extra-vars", "display_skipped_hosts=false", + "--extra-vars", "build_username=${var.build_username}", + "--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}", + ] + } + + post-processor "manifest" { + output = local.manifest_output + strip_path = true + strip_time = true + custom_data = { + ansible_username = var.ansible_username + build_username = var.build_username + build_date = local.build_date + build_version = local.build_version + common_data_source = var.common_data_source + common_vm_version = var.common_vm_version + vm_cpu_cores = var.vm_cpu_cores + vm_cpu_count = var.vm_cpu_count + vm_disk_size = var.vm_disk_size + vm_disk_thin_provisioned = var.vm_disk_thin_provisioned + vm_firmware = var.vm_firmware + vm_guest_os_type = var.vm_guest_os_type + vm_mem_size = var.vm_mem_size + vm_network_card = var.vm_network_card + vsphere_cluster = var.vsphere_cluster + vsphere_host = var.vsphere_host + vsphere_datacenter = var.vsphere_datacenter + vsphere_datastore = var.vsphere_datastore + vsphere_endpoint = var.vsphere_endpoint + vsphere_folder = var.vsphere_folder + } + } + + dynamic "hcp_packer_registry" { + for_each = var.common_hcp_packer_registry_enabled ? [1] : [] + content { + bucket_name = local.bucket_name + description = local.bucket_description + bucket_labels = { + "os_family" : var.vm_guest_os_family, + "os_name" : var.vm_guest_os_name, + "os_version" : var.vm_guest_os_version, + } + build_labels = { + "build_version" : local.build_version, + "packer_version" : packer.version, + } + } + } +} diff --git a/builds/linux/fedora/39/linux-fedora.pkrvars.hcl.example b/builds/linux/fedora/39/linux-fedora.pkrvars.hcl.example new file mode 100644 index 000000000..03f8abb18 --- /dev/null +++ b/builds/linux/fedora/39/linux-fedora.pkrvars.hcl.example @@ -0,0 +1,46 @@ +# Copyright 2023-2024 Broadcom. All rights reserved. +# SPDX-License-Identifier: BSD-2 + +/* + DESCRIPTION: + Fedora Server 40 build variables. + Packer Plugin for VMware vSphere: 'vsphere-iso' builder. +*/ + +// Guest Operating System Metadata +vm_guest_os_language = "en_US" +vm_guest_os_keyboard = "us" +vm_guest_os_timezone = "UTC" +vm_guest_os_family = "linux" +vm_guest_os_name = "fedora" +vm_guest_os_version = "39" + +// Virtual Machine Guest Operating System Setting +vm_guest_os_type = "rhel9_64Guest" + +// Virtual Machine Hardware Settings +vm_firmware = "efi-secure" +vm_cdrom_type = "sata" +vm_cdrom_count = 1 +vm_cpu_count = 2 +vm_cpu_cores = 1 +vm_cpu_hot_add = false +vm_mem_size = 2048 +vm_mem_hot_add = false +vm_disk_size = 40960 +vm_disk_controller_type = ["pvscsi"] +vm_disk_thin_provisioned = true +vm_network_card = "vmxnet3" + +// Removable Media Settings +iso_datastore_path = "iso/linux/fedora" +iso_content_library_item = "Fedora-Server-dvd-x86_64-39-1.5" +iso_file = "Fedora-Server-dvd-x86_64-39-1.5.iso" + +// Boot Settings +vm_boot_order = "disk,cdrom" +vm_boot_wait = "2s" + +// Communicator Settings +communicator_port = 22 +communicator_timeout = "30m" diff --git a/builds/linux/fedora/39/variables-network.pkr.hcl b/builds/linux/fedora/39/variables-network.pkr.hcl new file mode 100644 index 000000000..61b3d8c42 --- /dev/null +++ b/builds/linux/fedora/39/variables-network.pkr.hcl @@ -0,0 +1,40 @@ +# Copyright 2023-2024 Broadcom. All rights reserved. +# SPDX-License-Identifier: BSD-2 + +/* + DESCRIPTION: + Fedora Server 40 network variables. + Packer Plugin for VMware vSphere: 'vsphere-iso' builder. +*/ + +// VM Network Settings + +variable "vm_network_device" { + type = string + description = "The network device of the VM." + default = "ens192" +} + +variable "vm_ip_address" { + type = string + description = "The IP address of the VM (e.g. 172.16.100.192)." + default = null +} + +variable "vm_ip_netmask" { + type = number + description = "The netmask of the VM (e.g. 24)." + default = null +} + +variable "vm_ip_gateway" { + type = string + description = "The gateway of the VM (e.g. 172.16.100.1)." + default = null +} + +variable "vm_dns_list" { + type = list(string) + description = "The nameservers of the VM." + default = [] +} diff --git a/builds/linux/fedora/39/variables-storage.pkr.hcl b/builds/linux/fedora/39/variables-storage.pkr.hcl new file mode 100644 index 000000000..8337ab11b --- /dev/null +++ b/builds/linux/fedora/39/variables-storage.pkr.hcl @@ -0,0 +1,57 @@ +# Copyright 2023-2024 Broadcom. All rights reserved. +# SPDX-License-Identifier: BSD-2 + +/* + DESCRIPTION: + Fedora Server 40 storage variables. + Packer Plugin for VMware vSphere: 'vsphere-iso' builder. +*/ + +// VM Storage Settings + +variable "vm_disk_device" { + type = string + description = "The device for the virtual disk. (e.g. 'sda')" +} + +variable "vm_disk_use_swap" { + type = bool + description = "Whether to use a swap partition." +} + +variable "vm_disk_partitions" { + type = list(object({ + name = string + size = number + format = object({ + label = string + fstype = string + }) + mount = object({ + path = string + options = string + }) + volume_group = string + })) + description = "The disk partitions for the virtual disk." +} + +variable "vm_disk_lvm" { + type = list(object({ + name = string + partitions = list(object({ + name = string + size = number + format = object({ + label = string + fstype = string + }) + mount = object({ + path = string + options = string + }) + })) + })) + description = "The LVM configuration for the virtual disk." + default = [] +} diff --git a/builds/linux/fedora/39/variables.pkr.hcl b/builds/linux/fedora/39/variables.pkr.hcl new file mode 100644 index 000000000..8cd85eab4 --- /dev/null +++ b/builds/linux/fedora/39/variables.pkr.hcl @@ -0,0 +1,439 @@ +# Copyright 2023-2024 Broadcom. All rights reserved. +# SPDX-License-Identifier: BSD-2 + +/* + DESCRIPTION: + Fedora Server 40 input variables. + Packer Plugin for VMware vSphere: 'vsphere-iso' builder. +*/ + +// BLOCK: variable +// Defines the input variables. + +// vSphere Credentials + +variable "vsphere_endpoint" { + type = string + description = "The fully qualified domain name or IP address of the vCenter Server instance." +} + +variable "vsphere_username" { + type = string + description = "The username to login to the vCenter Server instance." + sensitive = true +} + +variable "vsphere_password" { + type = string + description = "The password for the login to the vCenter Server instance." + sensitive = true +} + +variable "vsphere_insecure_connection" { + type = bool + description = "Do not validate vCenter Server TLS certificate." +} + +// vSphere Settings + +variable "vsphere_datacenter" { + type = string + description = "The name of the target vSphere datacenter." + default = "" +} + +variable "vsphere_cluster" { + type = string + description = "The name of the target vSphere cluster." + default = "" +} + +variable "vsphere_host" { + type = string + description = "The name of the target ESXi host." + default = "" +} + +variable "vsphere_datastore" { + type = string + description = "The name of the target vSphere datastore." +} + +variable "vsphere_network" { + type = string + description = "The name of the target vSphere network segment." +} + +variable "vsphere_folder" { + type = string + description = "The name of the target vSphere folder." + default = "" +} + +variable "vsphere_resource_pool" { + type = string + description = "The name of the target vSphere resource pool." + default = "" +} + +variable "vsphere_set_host_for_datastore_uploads" { + type = bool + description = "Set this to true if packer should use the host for uploading files to the datastore." + default = false +} + +// Virtual Machine Settings + +variable "vm_guest_os_language" { + type = string + description = "The guest operating system lanugage." + default = "en_US" +} + +variable "vm_guest_os_keyboard" { + type = string + description = "The guest operating system keyboard input." + default = "us" +} + +variable "vm_guest_os_timezone" { + type = string + description = "The guest operating system timezone." + default = "UTC" +} + +variable "vm_guest_os_family" { + type = string + description = "The guest operating system family. Used for naming and VMware Tools." +} + +variable "vm_guest_os_name" { + type = string + description = "The guest operating system name. Used for naming." +} + +variable "vm_guest_os_version" { + type = string + description = "The guest operating system version. Used for naming." +} + +variable "vm_guest_os_type" { + type = string + 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." + default = "efi-secure" +} + +variable "vm_cdrom_type" { + type = string + description = "The virtual machine CD-ROM type." + default = "sata" +} + +variable "vm_cdrom_count" { + type = string + description = "The number of virtual CD-ROMs remaining after the build." + default = 1 +} + +variable "vm_cpu_count" { + type = number + description = "The number of virtual CPUs." +} + +variable "vm_cpu_cores" { + type = number + description = "The number of virtual CPUs cores per socket." +} + +variable "vm_cpu_hot_add" { + type = bool + description = "Enable hot add CPU." + default = false +} + +variable "vm_mem_size" { + type = number + description = "The size for the virtual memory in MB." +} + +variable "vm_mem_hot_add" { + type = bool + description = "Enable hot add memory." + default = false +} + +variable "vm_disk_size" { + type = number + description = "The size for the virtual disk in MB." +} + +variable "vm_disk_controller_type" { + type = list(string) + description = "The virtual disk controller types in sequence." + default = ["pvscsi"] +} + +variable "vm_disk_thin_provisioned" { + type = bool + description = "Thin provision the virtual disk." + default = true +} + +variable "vm_network_card" { + type = string + description = "The virtual network card type." + default = "vmxnet3" +} + +variable "common_vm_version" { + type = number + description = "The vSphere virtual hardware version." +} + +variable "common_tools_upgrade_policy" { + type = bool + description = "Upgrade VMware Tools on reboot." + default = true +} + +variable "common_remove_cdrom" { + type = bool + description = "Remove the virtual CD-ROM(s)." + default = true +} + +// Template and Content Library Settings + +variable "common_template_conversion" { + type = bool + description = "Convert the virtual machine to template. Must be 'false' for content library." + default = false +} + +variable "common_content_library_enabled" { + type = bool + description = "Import the virtual machine into the vSphere content library." + default = true +} + +variable "common_content_library" { + type = string + description = "The name of the target vSphere content library, if enabled." + default = null +} + +variable "common_content_library_ovf" { + type = bool + description = "Export to content library as an OVF template." + default = true +} + +variable "common_content_library_destroy" { + type = bool + description = "Delete the virtual machine after exporting to the content library." + default = true +} + +variable "common_content_library_skip_export" { + type = bool + description = "Skip exporting the virtual machine to the content library. Option allows for testing/debugging without saving the machine image." + default = false +} + +// OVF Export Settings + +variable "common_ovf_export_enabled" { + type = bool + description = "Enable OVF artifact export." + default = false +} + +variable "common_ovf_export_overwrite" { + type = bool + description = "Overwrite existing OVF artifact." + default = true +} + +// Removable Media Settings + +variable "common_iso_content_library_enabled" { + type = bool + description = "Import the guest operating system ISO into the vSphere content library." + default = false +} + +variable "common_iso_content_library" { + type = string + description = "The name of the target vSphere content library for the guest operating system ISO." +} + +variable "common_iso_datastore" { + type = string + description = "The name of the target vSphere datastore for the guest operating system ISO." +} + +variable "iso_datastore_path" { + type = string + description = "The path on the source vSphere datastore for the guest operating system ISO." +} + +variable "iso_file" { + type = string + description = "The file name of the guest operating system ISO." +} + +variable "iso_content_library_item" { + type = string + description = "The vSphere content library item name for the guest operating system ISO." +} + +// Boot Settings + +variable "common_data_source" { + type = string + description = "The provisioning data source. One of `http` or `disk`." +} + +variable "common_http_ip" { + type = string + description = "Define an IP address on the host to use for the HTTP server." + default = null +} + +variable "common_http_port_min" { + type = number + description = "The start of the HTTP port range." +} + +variable "common_http_port_max" { + type = number + description = "The end of the HTTP port range." +} + +variable "vm_boot_order" { + type = string + description = "The boot order for virtual machines devices." + default = "disk,cdrom" +} + +variable "vm_boot_wait" { + type = string + description = "The time to wait before boot." +} + +variable "common_ip_wait_timeout" { + type = string + description = "Time to wait for guest operating system IP address response." +} + +variable "common_ip_settle_timeout" { + type = string + description = "Time to wait for guest operating system IP to settle down." + default = "5s" +} + +variable "common_shutdown_timeout" { + type = string + description = "Time to wait for guest operating system shutdown." +} + +// Communicator Settings and Credentials + +variable "build_username" { + type = string + description = "The username to login to the guest operating system." + sensitive = true +} + +variable "build_password" { + type = string + description = "The password to login to the guest operating system." + sensitive = true +} + +variable "build_password_encrypted" { + type = string + description = "The SHA-512 encrypted password to login to the guest operating system." + sensitive = true +} + +variable "build_key" { + type = string + description = "The public key to login to the guest operating system." + sensitive = true +} + +variable "communicator_proxy_host" { + type = string + description = "The proxy server to use for SSH connection. (Optional)" + default = null +} + +variable "communicator_proxy_port" { + type = number + description = "The port to connect to the proxy server. (Optional)" + default = null +} + +variable "communicator_proxy_username" { + type = string + description = "The username to authenticate with the proxy server. (Optional)" + default = null +} + +variable "communicator_proxy_password" { + type = string + description = "The password to authenticate with the proxy server. (Optional)" + sensitive = true + default = null +} + +variable "communicator_port" { + type = string + description = "The port for the communicator protocol." +} + +variable "communicator_timeout" { + type = string + description = "The timeout for the communicator protocol." +} + +// Ansible Credentials + +variable "ansible_username" { + type = string + description = "The username for Ansible to login to the guest operating system." + sensitive = true +} + +variable "ansible_key" { + type = string + description = "The public key for Ansible to login to the guest operating system." + sensitive = true +} + +// HCP Packer Settings + +variable "common_hcp_packer_registry_enabled" { + type = bool + description = "Enable the HCP Packer registry." + default = false +} +// Additional Settings + +variable "additional_packages" { + type = list(string) + description = "Additional packages to install." + default = [] +} diff --git a/builds/linux/rhel/9/data/ks.pkrtpl.hcl b/builds/linux/rhel/9/data/ks.pkrtpl.hcl index fd5de8dd3..968fb2516 100644 --- a/builds/linux/rhel/9/data/ks.pkrtpl.hcl +++ b/builds/linux/rhel/9/data/ks.pkrtpl.hcl @@ -1,7 +1,7 @@ # Copyright 2023-2024 Broadcom. All rights reserved. # SPDX-License-Identifier: BSD-2 -# Red Hat Enterprise Linux Server 9 +# Red Hat Enterprise Linux 9 ### Installs from the first attached CD-ROM/DVD on the system. cdrom diff --git a/docs/getting-started/iso.md b/docs/getting-started/iso.md index 96c076b8d..e2e85139a 100644 --- a/docs/getting-started/iso.md +++ b/docs/getting-started/iso.md @@ -4,36 +4,36 @@ icon: octicons/stack-24 # Guest Operating Systems -The project allows the use of a datastore (default) or a content library to store your guest -operating system [ISO][iso] files. +The project allows the use of a datastore (default) or a content library to store your guest operating system [ISO][iso] files. ## :fontawesome-brands-linux: Linux Distributions Download the Linux distribution ISO files from the publisher. ::spantable:: -| Operating System | Version | Download | -| :--- | :--- | :--- | -| :simple-vmware:    VMware Photon OS @span | 5.0 | [:fontawesome-solid-cloud-arrow-down:][download-linux-photon-5]   `photon-5.0-xxxxxxxxx.x86_64.iso` | -| | 4.0 | [:fontawesome-solid-cloud-arrow-down:][download-linux-photon-4]   `photon-4.0-xxxxxxxxx.iso` | -| :fontawesome-brands-debian:    Debian @span | 12 | [:fontawesome-solid-cloud-arrow-down:][download-linux-debian-12]   `debian-12.x.x-amd64-netinst.iso` | -| | 11 | [:fontawesome-solid-cloud-arrow-down:][download-linux-debian-11]   `debian-11.x.x-amd64-netinst.iso` | -| :fontawesome-brands-ubuntu:    Ubuntu Server @span | 24.04 LTS | [:fontawesome-solid-cloud-arrow-down:][download-linux-ubuntu-2310]   `ubuntu-23.10-live-server-amd64.iso` | -| | 22.04 LTS | [:fontawesome-solid-cloud-arrow-down:][download-linux-ubuntu-2204]   `ubuntu-22.04.x-live-server-amd64.iso` | -| | 20.04 LTS | [:fontawesome-solid-cloud-arrow-down:][download-linux-ubuntu-2004]   `ubuntu-20.04.x-live-server-amd64.iso` | -| :fontawesome-brands-redhat:    Red Hat Enterprise Linux @span | 9 | [:fontawesome-solid-cloud-arrow-down:][download-linux-rhel-9]   `rhel-9.x-x86_64-dvd.iso` | -| | 8 | [:fontawesome-solid-cloud-arrow-down:][download-linux-rhel-8]   `rhel-8.x-x86_64-dvd.iso` | -| | 7 | [:fontawesome-solid-cloud-arrow-down:][download-linux-rhel-7]   `rhel-server-7.x-x86_64-dvd.iso` | -| :fontawesome-brands-linux:    AlmaLinux OS @span | 9 | [:fontawesome-solid-cloud-arrow-down:][download-linux-alma-9]   `AlmaLinux-9.x-x86_64-dvd.iso` | -| | 8 | [:fontawesome-solid-cloud-arrow-down:][download-linux-alma-8]   `AlmaLinux-8.x-x86_64-dvd.iso` | -| :simple-rockylinux:    Rocky Linux @span | 9 | [:fontawesome-solid-cloud-arrow-down:][download-linux-rocky-9]   `Rocky-9.x-x86_64-dvd.iso` | -| | 8 | [:fontawesome-solid-cloud-arrow-down:][download-linux-rocky-8]   `Rocky-8.x-x86_64-dvd.iso` | -| :simple-oracle:    Oracle Linux @span | 9 | [:fontawesome-solid-cloud-arrow-down:][download-linux-oracle-9]   `OracleLinux-R9-U2-x86_64-dvd.iso` | -| | 8 | [:fontawesome-solid-cloud-arrow-down:][download-linux-oracle-8]   `OracleLinux-R8-U8-x86_64-dvd.iso` | -| :fontawesome-brands-centos:    CentOS @span | 9 Stream | [:fontawesome-solid-cloud-arrow-down:][download-linux-centos-stream-9]   `CentOS-Stream-9-latest-x86_64-dvd1.iso` | -| | 8 Stream | [:fontawesome-solid-cloud-arrow-down:][download-linux-centos-stream-8]   `CentOS-Stream-8-x86_64-latest-dvd1.iso` | -| | 7 | [:fontawesome-solid-cloud-arrow-down:][download-linux-centos-7]   `CentOS-7-x86_64-DVD.iso` | -| :fontawesome-brands-suse:    SUSE Linux Enterprise @span | 15 | [:fontawesome-solid-cloud-arrow-down:][download-linux-sles-15]   `SLE-15-SPx-Full-x86_64-GM-Media1.iso` | +| Operating System | Version | Download | +| :--- | :--- | :--- | +| :simple-vmware:    VMware Photon OS @span | 5.0 | [:fontawesome-solid-cloud-arrow-down:][download-linux-photon-5]   `photon-5.0-xxxxxxxxx.x86_64.iso` | +| | 4.0 | [:fontawesome-solid-cloud-arrow-down:][download-linux-photon-4]   `photon-4.0-xxxxxxxxx.iso` | +| :fontawesome-brands-debian:    Debian @span | 12 | [:fontawesome-solid-cloud-arrow-down:][download-linux-debian-12]   `debian-12.x.x-amd64-netinst.iso` | +| | 11 | [:fontawesome-solid-cloud-arrow-down:][download-linux-debian-11]   `debian-11.x.x-amd64-netinst.iso` | +| :fontawesome-brands-ubuntu:    Ubuntu Server @span | 24.04 LTS | [:fontawesome-solid-cloud-arrow-down:][download-linux-ubuntu-2310]   `ubuntu-24.04.x-live-server-amd64.iso` | +| | 22.04 LTS | [:fontawesome-solid-cloud-arrow-down:][download-linux-ubuntu-2204]   `ubuntu-22.04.x-live-server-amd64.iso` | +| | 20.04 LTS | [:fontawesome-solid-cloud-arrow-down:][download-linux-ubuntu-2004]   `ubuntu-20.04.x-live-server-amd64.iso` | +| :fontawesome-brands-redhat:    Red Hat Enterprise Linux @span | 9 | [:fontawesome-solid-cloud-arrow-down:][download-linux-rhel-9]   `rhel-9.x-x86_64-dvd.iso` | +| | 8 | [:fontawesome-solid-cloud-arrow-down:][download-linux-rhel-8]   `rhel-8.x-x86_64-dvd.iso` | +| | 7 | [:fontawesome-solid-cloud-arrow-down:][download-linux-rhel-7]   `rhel-server-7.x-x86_64-dvd.iso` | +| :fontawesome-brands-linux:    AlmaLinux OS @span | 9 | [:fontawesome-solid-cloud-arrow-down:][download-linux-alma-9]   `AlmaLinux-9.x-x86_64-dvd.iso` | +| | 8 | [:fontawesome-solid-cloud-arrow-down:][download-linux-alma-8]   `AlmaLinux-8.x-x86_64-dvd.iso` | +| :simple-rockylinux:    Rocky Linux @span | 9 | [:fontawesome-solid-cloud-arrow-down:][download-linux-rocky-9]   `Rocky-9.x-x86_64-dvd.iso` | +| | 8 | [:fontawesome-solid-cloud-arrow-down:][download-linux-rocky-8]   `Rocky-8.x-x86_64-dvd.iso` | +| :simple-oracle:    Oracle Linux @span | 9 | [:fontawesome-solid-cloud-arrow-down:][download-linux-oracle-9]   `OracleLinux-R9-U2-x86_64-dvd.iso` | +| | 8 | [:fontawesome-solid-cloud-arrow-down:][download-linux-oracle-8]   `OracleLinux-R8-U8-x86_64-dvd.iso` | +| :fontawesome-brands-centos:    CentOS @span | 9 Stream | [:fontawesome-solid-cloud-arrow-down:][download-linux-centos-stream-9]   `CentOS-Stream-9-latest-x86_64-dvd1.iso` | +| | 8 Stream | [:fontawesome-solid-cloud-arrow-down:][download-linux-centos-stream-8]   `CentOS-Stream-8-x86_64-latest-dvd1.iso` | +| | 7 | [:fontawesome-solid-cloud-arrow-down:][download-linux-centos-7]   `CentOS-7-x86_64-DVD.iso` | +| :fontawesome-brands-fedora:    Fedora Server @span | 39 | [:fontawesome-solid-cloud-arrow-down:][download-linux-centos-stream-9]   `Fedora-Server-dvd-x86_64-39-x.iso.iso` | +| :fontawesome-brands-suse:    SUSE Linux Enterprise @span | 15 | [:fontawesome-solid-cloud-arrow-down:][download-linux-sles-15]   `SLE-15-SPx-Full-x86_64-GM-Media1.iso` | ::end-spantable:: ## :fontawesome-brands-windows: Microsoft Windows @@ -41,13 +41,13 @@ Download the Linux distribution ISO files from the publisher. Download the Microsoft Windows ISO files from the Microsoft. ::spantable:: -| Operating System | Version | Download | -| :--- | :--- | :--- | -| :fontawesome-brands-windows:    Microsoft Windows Server @span | 2025 | [:fontawesome-solid-cloud-arrow-down:][download-windows-server-2025]   Windows Insiders Preview | -| | 2022 | [:fontawesome-solid-cloud-arrow-down:][download-windows-server-2022]   Windows Evaluation Center | -| | 2019 | [:fontawesome-solid-cloud-arrow-down:][download-windows-server-2019]   Windows Evaluation Center | -| :fontawesome-brands-windows:    Microsoft Windows @span | 11 | [:fontawesome-solid-cloud-arrow-down:][download-windows-11]   Windows Evaluation Center | -| | 10 | [:fontawesome-solid-cloud-arrow-down:][download-windows-10]   Windows Evaluation Center | +| Operating System | Version | Download | +| :--- | :--- | :--- | +| :fontawesome-brands-windows:    Microsoft Windows Server @span | 2025 | [:fontawesome-solid-cloud-arrow-down:][download-windows-server-2025]   Windows Insiders Preview | +| | 2022 | [:fontawesome-solid-cloud-arrow-down:][download-windows-server-2022]   Windows Evaluation Center | +| | 2019 | [:fontawesome-solid-cloud-arrow-down:][download-windows-server-2019]   Windows Evaluation Center | +| :fontawesome-brands-windows:    Microsoft Windows @span | 11 | [:fontawesome-solid-cloud-arrow-down:][download-windows-11]   Windows Evaluation Center | +| | 10 | [:fontawesome-solid-cloud-arrow-down:][download-windows-10]   Windows Evaluation Center | ::end-spantable:: Upload the guest operating system ISO files to the datastore and update the path in the @@ -71,11 +71,11 @@ configuration variables. Update the ISO path and file for each guest operating system in the configuration variables. -````hcl title="builds/linux/photon/5/packer.auto.pkrvars.hcl" +```hcl title="builds/linux/photon/5/packer.auto.pkrvars.hcl" iso_datastore_path = "iso/linux/photon" iso_content_library_item = "photon-5.0-xxxxxxxxx" iso_file = "photon-5.0-xxxxxxxxx.iso" -```**** +``` [//]: Links [download-linux-alma-8]: https://mirrors.almalinux.org/isos/x86_64/8.9.html @@ -83,25 +83,25 @@ iso_file = "photon-5.0-xxxxxxxxx.iso" [download-linux-centos-7]: http://isoredirect.centos.org/centos/7/isos/x86_64/ [download-linux-centos-stream-8]: http://isoredirect.centos.org/centos/8-stream/isos/x86_64/ [download-linux-centos-stream-9]: http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/iso/ -[download-linux-debian-12]: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/ [download-linux-debian-11]: https://cdimage.debian.org/cdimage/archive/11.9.0/amd64/iso-cd/ -[download-linux-oracle-9]: https://yum.oracle.com/oracle-linux-isos.html +[download-linux-debian-12]: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/ +[download-linux-fedora-39]: https://download.fedoraproject.org/pub/fedora/linux/releases/39/Server/x86_64/iso/ [download-linux-oracle-8]: https://yum.oracle.com/oracle-linux-isos.html -[download-linux-photon-5]: https://packages.vmware.com/photon/5.0/GA/iso/ +[download-linux-oracle-9]: https://yum.oracle.com/oracle-linux-isos.html [download-linux-photon-4]: https://packages.vmware.com/photon/4.0/Rev2/iso/ +[download-linux-photon-5]: https://packages.vmware.com/photon/5.0/GA/iso/ [download-linux-rhel-7]: https://access.redhat.com/downloads/content/69/ver=/rhel---7/7.9/x86_64/product-software [download-linux-rhel-8]: https://access.redhat.com/downloads/content/479/ver=/rhel---8/8.9/x86_64/product-software [download-linux-rhel-9]: https://access.redhat.com/downloads/content/479/ver=/rhel---9/9.3/x86_64/product-software -[download-linux-rocky-9]: https://download.rockylinux.org/pub/rocky/9/isos/x86_64/ [download-linux-rocky-8]: https://download.rockylinux.org/pub/rocky/8/isos/x86_64/ +[download-linux-rocky-9]: https://download.rockylinux.org/pub/rocky/9/isos/x86_64/ [download-linux-sles-15]: https://www.suse.com/download/sles/ [download-linux-ubuntu-2004]: https://releases.ubuntu.com/20.04/ [download-linux-ubuntu-2204]: https://releases.ubuntu.com/22.04/ [download-linux-ubuntu-2404]: https://releases.ubuntu.com/24.04/ -[download-windows-server-2022]: https://www.microsoft.com/evalcenter/evaluate-windows-server-2022 [download-windows-server-2019]: https://www.microsoft.com/evalcenter/evaluate-windows-server-2019 +[download-windows-server-2022]: https://www.microsoft.com/evalcenter/evaluate-windows-server-2022 [download-windows-server-2025]: https://www.microsoft.com/en-us/software-download/windowsinsiderpreviewserver -[download-windows-11]: https://www.microsoft.com/evalcenter/evaluate-windows-11-enterprise [download-windows-10]: https://www.microsoft.com/evalcenter/evaluate-windows-10-enterprise +[download-windows-11]: https://www.microsoft.com/evalcenter/evaluate-windows-11-enterprise [iso]: https://en.wikipedia.org/wiki/ISO_imageGUID-58D77EA5-50D9-4A8E-A15A-D7B3ABA11B87.html -```` diff --git a/docs/index.md b/docs/index.md index 2c9821ff8..56e5a23c1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -17,8 +17,8 @@ This project supports the following guest operating systems: ::spantable:: | Operating System | Version | VMTools Customization | Cloud-Init Customization | Network Variables | Storage Variables | | :--- | :--- | :--- | :--- | :--- | :--- | -| :simple-broadcom:    VMware Photon OS @span | 5.0 | :octicons-check-circle-24:{ .green } | :octicons-x-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | :octicons-x-circle-24: | -| | 4.0 | :octicons-check-circle-24:{ .green } | :octicons-x-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | :octicons-x-circle-24: | +| :simple-broadcom:    VMware Photon OS @span | 5.0 | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | :octicons-x-circle-24: | +| | 4.0 | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | :octicons-x-circle-24: | | :fontawesome-brands-debian:    Debian @span | 12 | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | | | 11 | :octicons-check-circle-24:{ .green } | :octicons-x-circle-24: | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | | :fontawesome-brands-ubuntu:    Ubuntu Server @span | 24.04 LTS | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | :octicons-check-circle-24:{ .green } | @@ -36,6 +36,7 @@ This project supports the following guest operating systems: | :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-centos:    Fedora @span | 40 | :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/download.sh b/download.sh index b0f5687dd..3ab185cbc 100755 --- a/download.sh +++ b/download.sh @@ -668,6 +668,11 @@ extract_checksum() { # Checksum extraction for Oracle Linux expected_checksum=$(grep "$file_name" "$checksum_file" | awk '{print $1}') ;; + "Fedora Server") + # Checksum extraction for Fedora Server + checksum_algorithm_upper=$(echo "$checksum_algorithm" | tr '[:lower:]' '[:upper:]') + expected_checksum=$(grep "$checksum_algorithm_upper ($file_name)" "$checksum_file" | awk -F'=' '{print $2}' | tr -d ' ') + ;; "Debian") # Checksum extraction for Debian expected_checksum=$(grep "$file_name" "$checksum_file" | awk '{print $1}') @@ -759,7 +764,7 @@ compare_checksums() { print_message error "Verification of checksum \033[31mfailed\033[0m for \033[34m$file_name\033[0m.\n" print_message info " - \033[32mExpected:\033[0m \033[34m$expected_checksum\033[0m\n" print_message info " - \033[31mActual:\033[0m \033[34m$actual_checksum\033[0m\n\n" - print_message error "Download \033[1m\033[31mfailed\033[0m\n for \033[34m$dist $version $arch\033[0m.\n" + print_message error "Download \033[1m\033[31mfailed\033[0m for \033[34m$dist $version $arch\033[0m.\n" if $cleanup_failed_iso_verification; then # Attempt to remove the downloaded ISO file. diff --git a/project.json b/project.json index b548c83d2..a0006cb42 100644 --- a/project.json +++ b/project.json @@ -276,7 +276,7 @@ "description": "CentOS", "publisher": { "name": "CentOS", - "url": "https://centos.org/" + "url": "https://centos.org" }, "versions": { "9": [ @@ -320,6 +320,29 @@ ] } }, + { + "name": "fedora-server", + "description": "Fedora Server", + "publisher": { + "name": "Fedora Project", + "url": "https://fedoraproject.org" + }, + "versions": { + "40": [ + { + "version": "40", + "architectures": [ + { + "architecture": "amd64", + "download_link": "https://na.edge.kernel.org/fedora/releases/40/Server/x86_64/iso/Fedora-Server-dvd-x86_64-40-1.14.iso", + "checksum_algorithm": "sha256", + "checksum": "https://na.edge.kernel.org/fedora/releases/40/Server/x86_64/iso/Fedora-Server-40-1.14-x86_64-CHECKSUM" + } + ] + } + ] + } + }, { "name": "sles", "description": "SUSE Linux Enterprise Server", @@ -471,7 +494,7 @@ "settings": { "iso_base_path": "iso", "rename_iso": false, - "cleanup_failed_iso_verification": true, + "cleanup_failed_iso_verification": false, "check_for_existing_iso": false, "download_logging_enabled": true, "download_logging_path": "",