From 6b20767d4797487f93d4949aa11d7ca622bfc104 Mon Sep 17 00:00:00 2001 From: Marcin Bojko Date: Wed, 19 Jun 2024 06:46:34 +0200 Subject: [PATCH] Version 1.1.5 --- CHANGELOG.md | 25 +- README.md | 79 +- .../15/proxmox/{ => bios}/autoinst.xml | 0 .../15/proxmox/uefi/autoinst.xml | 1345 +++++++++++++++++ extra/files/oraclelinux/8/proxmox/ks.cfg | 12 +- extra/files/redhat/7/ks-kvm-uefi.cfg | 104 ++ .../files/{gen2-rhel7 => redhat/7}/ks-kvm.cfg | 0 .../ks.cfg.bak => redhat/8/ks-kvm-uefi.cfg} | 57 +- .../ks-kvm8.cfg => redhat/8/ks-kvm.cfg} | 0 extra/files/ubuntu/24.04/hyperv/meta-data | 0 extra/files/ubuntu/24.04/hyperv/user-data | 109 ++ .../files/ubuntu/24.04/proxmox-uefi/meta-data | 0 .../files/ubuntu/24.04/proxmox-uefi/user-data | 109 ++ extra/files/ubuntu/24.04/uefi.sh | 17 + extra/playbooks/provision_alma8_variables.yml | 6 + extra/playbooks/provision_rhel.yaml | 18 +- proxmox/proxmox_rhel.pkr.hcl | 105 +- proxmox/proxmox_sles.pkr.hcl | 95 +- proxmox/proxmox_ubuntu.pkr.hcl | 95 +- proxmox/proxmox_windows.pkr.hcl | 26 + ....hcl => variables_almalinux810.pkvars.hcl} | 0 .../variables_almalinux810_uefi.pkvars.hcl | 9 + ...s.hcl => variables_almalinux88.pkvars.hcl} | 2 +- proxmox/variables_almalinux88_uefi.pkvars.hcl | 9 + ...s.hcl => variables_almalinux89.pkvars.hcl} | 2 +- proxmox/variables_almalinux89_uefi.pkvars.hcl | 9 + ...s.hcl => variables_almalinux92.pkvars.hcl} | 2 +- proxmox/variables_almalinux92_uefi.pkvars.hcl | 9 + ...s.hcl => variables_almalinux93.pkvars.hcl} | 2 +- proxmox/variables_almalinux93_uefi.pkvars.hcl | 9 + ...s.hcl => variables_almalinux94.pkvars.hcl} | 0 proxmox/variables_almalinux94_uefi.pkvars.hcl | 9 + ...> variables_opensuse_leap_15_5.pkvars.hcl} | 2 +- ...riables_opensuse_leap_15_5_uefi.pkvars.hcl | 10 + .../variables_opensuse_leap_15_6.pkvars.hcl | 36 + ...riables_opensuse_leap_15_6_uefi.pkvars.hcl | 9 + ...cl => variables_oraclelinux810.pkvars.hcl} | 0 .../variables_oraclelinux810_uefi.pkvars.hcl | 9 + ...hcl => variables_oraclelinux88.pkvars.hcl} | 2 +- .../variables_oraclelinux88_uefi.pkvars.hcl | 9 + ...hcl => variables_oraclelinux89.pkvars.hcl} | 2 +- .../variables_oraclelinux89_uefi.pkvars.hcl | 9 + ...hcl => variables_oraclelinux92.pkvars.hcl} | 2 +- .../variables_oraclelinux92_uefi.pkvars.hcl | 9 + ...hcl => variables_oraclelinux93.pkvars.hcl} | 2 +- .../variables_oraclelinux93_uefi.pkvars.hcl | 9 + ...hcl => variables_oraclelinux94.pkvars.hcl} | 0 .../variables_oraclelinux94_uefi.pkvars.hcl | 9 + ...hcl => variables_rockylinux810.pkvars.hcl} | 2 - .../variables_rockylinux810_uefi.pkvars.hcl | 9 + ....hcl => variables_rockylinux88.pkvars.hcl} | 3 +- .../variables_rockylinux88_uefi.pkvars.hcl | 9 + ....hcl => variables_rockylinux89.pkvars.hcl} | 2 +- .../variables_rockylinux89_uefi.pkvars.hcl | 9 + ....hcl => variables_rockylinux92.pkvars.hcl} | 2 +- .../variables_rockylinux92_uefi.pkvars.hcl | 9 + ....hcl => variables_rockylinux93.pkvars.hcl} | 2 +- .../variables_rockylinux93_uefi.pkvars.hcl | 9 + ....hcl => variables_rockylinux94.pkvars.hcl} | 0 .../variables_rockylinux94_uefi.pkvars.hcl | 9 + ...rs.hcl => variables_ubuntu2204.pkvars.hcl} | 0 proxmox/variables_ubuntu2204_uefi.pkvars.hcl | 9 + ...rs.hcl => variables_ubuntu2304.pkvars.hcl} | 0 proxmox/variables_ubuntu2304_uefi.pkvars.hcl | 9 + ...rs.hcl => variables_ubuntu2404.pkvars.hcl} | 0 proxmox/variables_ubuntu2404_uefi.pkvars.hcl | 9 + ...cl => variables_windows2019-dc.pkvars.hcl} | 0 .../variables_windows2019-dc_uefi.pkvars.hcl | 9 + ...l => variables_windows2019-std.pkvars.hcl} | 0 .../variables_windows2019-std_uefi.pkvars.hcl | 9 + ...cl => variables_windows2022-dc.pkvars.hcl} | 2 +- .../variables_windows2022-dc_uefi.pkvars.hcl | 9 + ...l => variables_windows2022-std.pkvars.hcl} | 0 .../variables_windows2022-std_uefi.pkvars.hcl | 9 + proxmox_almalinux_810.sh | 47 - proxmox_almalinux_88.sh | 47 - proxmox_almalinux_89.sh | 47 - proxmox_almalinux_92.sh | 46 - proxmox_almalinux_93.sh | 46 - proxmox_almalinux_94.sh | 46 - proxmox_generic.sh | 164 ++ proxmox_opensuse_leap_15_5.sh | 47 - proxmox_oraclelinux_810.sh | 47 - proxmox_oraclelinux_88.sh | 47 - proxmox_oraclelinux_89.sh | 47 - proxmox_oraclelinux_92.sh | 46 - proxmox_oraclelinux_93.sh | 46 - proxmox_oraclelinux_94.sh | 46 - proxmox_rockylinux_810.sh | 46 - proxmox_rockylinux_88.sh | 46 - proxmox_rockylinux_89.sh | 46 - proxmox_rockylinux_92.sh | 48 - proxmox_rockylinux_93.blank.sh | 48 - proxmox_rockylinux_93.sh | 48 - proxmox_rockylinux_94.sh | 48 - proxmox_ubuntu_2204.sh | 47 - proxmox_ubuntu_2204_hwe.sh | 47 - proxmox_ubuntu_2304.sh | 47 - proxmox_ubuntu_2404.sh | 47 - proxmox_windows_2019-dc.sh | 56 - proxmox_windows_2019-std.sh | 54 - proxmox_windows_2022-dc.sh | 56 - proxmox_windows_2022-std.sh | 54 - 103 files changed, 2606 insertions(+), 1414 deletions(-) rename extra/files/opensuse_leap/15/proxmox/{ => bios}/autoinst.xml (100%) create mode 100644 extra/files/opensuse_leap/15/proxmox/uefi/autoinst.xml create mode 100644 extra/files/redhat/7/ks-kvm-uefi.cfg rename extra/files/{gen2-rhel7 => redhat/7}/ks-kvm.cfg (100%) rename extra/files/{oraclelinux/8/proxmox/ks.cfg.bak => redhat/8/ks-kvm-uefi.cfg} (57%) rename extra/files/{gen2-rhel7/ks-kvm8.cfg => redhat/8/ks-kvm.cfg} (100%) create mode 100644 extra/files/ubuntu/24.04/hyperv/meta-data create mode 100644 extra/files/ubuntu/24.04/hyperv/user-data create mode 100644 extra/files/ubuntu/24.04/proxmox-uefi/meta-data create mode 100644 extra/files/ubuntu/24.04/proxmox-uefi/user-data create mode 100644 extra/files/ubuntu/24.04/uefi.sh rename proxmox/{variables_proxmox_almalinux810.pkvars.hcl => variables_almalinux810.pkvars.hcl} (100%) create mode 100644 proxmox/variables_almalinux810_uefi.pkvars.hcl rename proxmox/{variables_proxmox_almalinux88.pkvars.hcl => variables_almalinux88.pkvars.hcl} (91%) create mode 100644 proxmox/variables_almalinux88_uefi.pkvars.hcl rename proxmox/{variables_proxmox_almalinux89.pkvars.hcl => variables_almalinux89.pkvars.hcl} (91%) create mode 100644 proxmox/variables_almalinux89_uefi.pkvars.hcl rename proxmox/{variables_proxmox_almalinux92.pkvars.hcl => variables_almalinux92.pkvars.hcl} (91%) create mode 100644 proxmox/variables_almalinux92_uefi.pkvars.hcl rename proxmox/{variables_proxmox_almalinux93.pkvars.hcl => variables_almalinux93.pkvars.hcl} (91%) create mode 100644 proxmox/variables_almalinux93_uefi.pkvars.hcl rename proxmox/{variables_proxmox_almalinux94.pkvars.hcl => variables_almalinux94.pkvars.hcl} (100%) create mode 100644 proxmox/variables_almalinux94_uefi.pkvars.hcl rename proxmox/{variables_proxmox_opensuse_leap_15_5.pkvars.hcl => variables_opensuse_leap_15_5.pkvars.hcl} (97%) create mode 100644 proxmox/variables_opensuse_leap_15_5_uefi.pkvars.hcl create mode 100644 proxmox/variables_opensuse_leap_15_6.pkvars.hcl create mode 100644 proxmox/variables_opensuse_leap_15_6_uefi.pkvars.hcl rename proxmox/{variables_proxmox_oraclelinux810.pkvars.hcl => variables_oraclelinux810.pkvars.hcl} (100%) create mode 100644 proxmox/variables_oraclelinux810_uefi.pkvars.hcl rename proxmox/{variables_proxmox_oraclelinux88.pkvars.hcl => variables_oraclelinux88.pkvars.hcl} (91%) create mode 100644 proxmox/variables_oraclelinux88_uefi.pkvars.hcl rename proxmox/{variables_proxmox_oraclelinux89.pkvars.hcl => variables_oraclelinux89.pkvars.hcl} (91%) create mode 100644 proxmox/variables_oraclelinux89_uefi.pkvars.hcl rename proxmox/{variables_proxmox_oraclelinux92.pkvars.hcl => variables_oraclelinux92.pkvars.hcl} (91%) create mode 100644 proxmox/variables_oraclelinux92_uefi.pkvars.hcl rename proxmox/{variables_proxmox_oraclelinux93.pkvars.hcl => variables_oraclelinux93.pkvars.hcl} (91%) create mode 100644 proxmox/variables_oraclelinux93_uefi.pkvars.hcl rename proxmox/{variables_proxmox_oraclelinux94.pkvars.hcl => variables_oraclelinux94.pkvars.hcl} (100%) create mode 100644 proxmox/variables_oraclelinux94_uefi.pkvars.hcl rename proxmox/{variables_proxmox_rockylinux810.pkvars.hcl => variables_rockylinux810.pkvars.hcl} (99%) create mode 100644 proxmox/variables_rockylinux810_uefi.pkvars.hcl rename proxmox/{variables_proxmox_rockylinux88.pkvars.hcl => variables_rockylinux88.pkvars.hcl} (91%) create mode 100644 proxmox/variables_rockylinux88_uefi.pkvars.hcl rename proxmox/{variables_proxmox_rockylinux89.pkvars.hcl => variables_rockylinux89.pkvars.hcl} (91%) create mode 100644 proxmox/variables_rockylinux89_uefi.pkvars.hcl rename proxmox/{variables_proxmox_rockylinux92.pkvars.hcl => variables_rockylinux92.pkvars.hcl} (91%) create mode 100644 proxmox/variables_rockylinux92_uefi.pkvars.hcl rename proxmox/{variables_proxmox_rockylinux93.pkvars.hcl => variables_rockylinux93.pkvars.hcl} (91%) create mode 100644 proxmox/variables_rockylinux93_uefi.pkvars.hcl rename proxmox/{variables_proxmox_rockylinux94.pkvars.hcl => variables_rockylinux94.pkvars.hcl} (100%) create mode 100644 proxmox/variables_rockylinux94_uefi.pkvars.hcl rename proxmox/{variables_proxmox_ubuntu2204.pkvars.hcl => variables_ubuntu2204.pkvars.hcl} (100%) create mode 100644 proxmox/variables_ubuntu2204_uefi.pkvars.hcl rename proxmox/{variables_proxmox_ubuntu2304.pkvars.hcl => variables_ubuntu2304.pkvars.hcl} (100%) create mode 100644 proxmox/variables_ubuntu2304_uefi.pkvars.hcl rename proxmox/{variables_proxmox_ubuntu2404.pkvars.hcl => variables_ubuntu2404.pkvars.hcl} (100%) create mode 100644 proxmox/variables_ubuntu2404_uefi.pkvars.hcl rename proxmox/{variables_proxmox_windows2019-dc.pkvars.hcl => variables_windows2019-dc.pkvars.hcl} (100%) create mode 100644 proxmox/variables_windows2019-dc_uefi.pkvars.hcl rename proxmox/{variables_proxmox_windows2019-std.pkvars.hcl => variables_windows2019-std.pkvars.hcl} (100%) create mode 100644 proxmox/variables_windows2019-std_uefi.pkvars.hcl rename proxmox/{variables_proxmox_windows2022-dc.pkvars.hcl => variables_windows2022-dc.pkvars.hcl} (96%) create mode 100644 proxmox/variables_windows2022-dc_uefi.pkvars.hcl rename proxmox/{variables_proxmox_windows2022-std.pkvars.hcl => variables_windows2022-std.pkvars.hcl} (100%) create mode 100644 proxmox/variables_windows2022-std_uefi.pkvars.hcl delete mode 100755 proxmox_almalinux_810.sh delete mode 100755 proxmox_almalinux_88.sh delete mode 100755 proxmox_almalinux_89.sh delete mode 100755 proxmox_almalinux_92.sh delete mode 100755 proxmox_almalinux_93.sh delete mode 100755 proxmox_almalinux_94.sh create mode 100755 proxmox_generic.sh delete mode 100755 proxmox_opensuse_leap_15_5.sh delete mode 100755 proxmox_oraclelinux_810.sh delete mode 100755 proxmox_oraclelinux_88.sh delete mode 100755 proxmox_oraclelinux_89.sh delete mode 100755 proxmox_oraclelinux_92.sh delete mode 100755 proxmox_oraclelinux_93.sh delete mode 100755 proxmox_oraclelinux_94.sh delete mode 100755 proxmox_rockylinux_810.sh delete mode 100755 proxmox_rockylinux_88.sh delete mode 100755 proxmox_rockylinux_89.sh delete mode 100755 proxmox_rockylinux_92.sh delete mode 100755 proxmox_rockylinux_93.blank.sh delete mode 100755 proxmox_rockylinux_93.sh delete mode 100755 proxmox_rockylinux_94.sh delete mode 100755 proxmox_ubuntu_2204.sh delete mode 100755 proxmox_ubuntu_2204_hwe.sh delete mode 100755 proxmox_ubuntu_2304.sh delete mode 100755 proxmox_ubuntu_2404.sh delete mode 100755 proxmox_windows_2019-dc.sh delete mode 100755 proxmox_windows_2019-std.sh delete mode 100755 proxmox_windows_2022-dc.sh delete mode 100755 proxmox_windows_2022-std.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e03ce2..269bd61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## Version 1.1.5 + +* [BREAKING_CHANGE] - Removed indivudial `.sh` files in favor of `proxmox_generic.sh` script. This script is now used for all Proxmox templates. Detailed usage with all options can be found in the `README.md` file. +* [FEATURE] - added EFI boot support for Proxmox. Every variable pack now has a new variable `use_efi` that can be set to `true` or `false`. If set to `true`, the template will be created with EFI boot support. If set to `false`, the template will be created with BIOS boot support. The default value is `false`. + * [PROXMOX] - added support for EFI boot for `RockyLinux` + * [PROXMOX] - added support for EFI boot for `AlmaLinux` + * [PROXMOX] - added support for EFI boot for `OracleLinux` + * [PROXMOX] - added support for EFI boot for `OpenSuse Leap` + * [PROXMOX] - added support for EFI boot for `Ubuntu` + * [PROXMOX] - added support for EFI boot for `Windows 2019` + * [PROXMOX] - added support for EFI boot for `Windows 2022` +* [ANSIBLE] - added added section `gpgkey` to playbook, for easy GPG key installation before any repository operations are initiated. This is useful for systems that changed their GPG keys. The format is as follows: + + ```yaml + gpgkey: + - url: "https://example.com/key.gpg" + state: present|absent + ``` + +* [ANSIBLE] - changed playbook version to 20240612 +* [ORACLE] - fixed `ks.cfg` for version 8 using LVM instead of plain disks. +* [PROXMOX] - added support for `OpenSuse Leap 15.6` + ## Version 1.1.4 * [PROXMOX] - added support `Oracle Linux 8.10` @@ -20,7 +43,7 @@ * [EXTRA] - fixed wrong version in unnatended file for Windows 219 * [PROXMOX] - fixed versions in template files for Windows 2022 * [PROXMOX] - added support for `AlmaLinux 9.4` -* [PROXMOX] - added support for `Oracle Linux 9.4` +* [PROXMOX] - added support for `Oracle Linux 9.4`\ * [PROXMOX] - added support for `Rocky Linux 9.4` * [KVM] - added support for `AlmaLinux 9.4` * [KVM] - added support for `Oracle Linux 9.4` diff --git a/README.md b/README.md index f1db23f..59330cf 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/marcinbojko) -Consider buying me a coffee if you like my work. All donations are appreciated. All donations will be used to pay for pipeline running costs - [Proxmox and KVM related Virtual Machines using Hashicorp's Packer](#proxmox-and-kvm-related-virtual-machines-using-hashicorps-packer) @@ -18,6 +17,7 @@ Consider buying me a coffee if you like my work. All donations are appreciated. - [Proxmox requirements](#proxmox-requirements) - [Usage](#usage) - [Provisioning](#provisioning) + - [Updates](#updates) - [KVM](#kvm) - [KVM Requirements](#kvm-requirements) - [Cloud-init support](#cloud-init-support) @@ -34,16 +34,19 @@ Consider buying me a coffee if you like my work. All donations are appreciated. - [Q & A](#q--a) + +Consider buying me a coffee if you like my work. All donations are appreciated. All donations will be used to pay for pipeline running costs + ## Proxmox ### Proxmox requirements - [Packer](https://www.packer.io/downloads) in version >= 1.10.0 -- [Proxmox](https://www.proxmox.com/en/downloads) in version >= 8.0 with CEPH and ZFS storage +- [Proxmox](https://www.proxmox.com/en/downloads) in version >= 8.0 with any storage (tested with CEPH and ZFS) - [Ansible] in version >= 2.10.0 - tested with `AMD Ryzen 9 5950X`, `Intel(R) Core(TM) i3-7100T` - at least 2GB of free RAM for virtual machines (4GB recommended) -- at least 100GB of free disk space for virtual machines (200GB recommended) on fast storage (SSD/NVME with LVM thinpool or ZFS) +- at least 100GB of free disk space for virtual machines (200GB recommended) on fast storage (SSD/NVME with LVM thinpool, Ceph or ZFS) ### Usage @@ -99,7 +102,65 @@ Consider buying me a coffee if you like my work. All donations are appreciated. Replace `bridge` with your bridge name. -- run proper script for dedicated OS +- run `proxmox_generic` script with proper parameters for dedicated OS + +| Command | OS FullName and Version | Boot Type | +|----------------------------------------------------------------|--------------------------------|-----------| +| ./proxmox_generic.sh -V almalinux88 -F rhel -U true | AlmaLinux 8.8 | UEFI | +| ./proxmox_generic.sh -V almalinux88 -F rhel -U false | AlmaLinux 8.8 | BIOS | +| ./proxmox_generic.sh -V almalinux89 -F rhel -U true | AlmaLinux 8.9 | UEFI | +| ./proxmox_generic.sh -V almalinux89 -F rhel -U false | AlmaLinux 8.9 | BIOS | +| ./proxmox_generic.sh -V almalinux810 -F rhel -U true | AlmaLinux 8.10 | UEFI | +| ./proxmox_generic.sh -V almalinux810 -F rhel -U false | AlmaLinux 8.10 | BIOS | +| ./proxmox_generic.sh -V almalinux92 -F rhel -U true | AlmaLinux 9.2 | UEFI | +| ./proxmox_generic.sh -V almalinux92 -F rhel -U false | AlmaLinux 9.2 | BIOS | +| ./proxmox_generic.sh -V almalinux93 -F rhel -U true | AlmaLinux 9.3 | UEFI | +| ./proxmox_generic.sh -V almalinux93 -F rhel -U false | AlmaLinux 9.3 | BIOS | +| ./proxmox_generic.sh -V almalinux94 -F rhel -U true | AlmaLinux 9.4 | UEFI | +| ./proxmox_generic.sh -V almalinux94 -F rhel -U false | AlmaLinux 9.4 | BIOS | +| ./proxmox_generic.sh -V opensuse_leap_15_5 -F sles -U true | openSUSE Leap 15.5 | UEFI | +| ./proxmox_generic.sh -V opensuse_leap_15_5 -F sles -U false | openSUSE Leap 15.5 | BIOS | +| ./proxmox_generic.sh -V opensuse_leap_15_6 -F sles -U true | openSUSE Leap 15.6 | UEFI | +| ./proxmox_generic.sh -V opensuse_leap_15_6 -F sles -U false | openSUSE Leap 15.6 | BIOS | +| ./proxmox_generic.sh -V oraclelinux810 -F rhel -U true | Oracle Linux 8.10 | UEFI | +| ./proxmox_generic.sh -V oraclelinux810 -F rhel -U false | Oracle Linux 8.10 | BIOS | +| ./proxmox_generic.sh -V oraclelinux88 -F rhel -U true | Oracle Linux 8.8 | UEFI | +| ./proxmox_generic.sh -V oraclelinux88 -F rhel -U false | Oracle Linux 8.8 | BIOS | +| ./proxmox_generic.sh -V oraclelinux89 -F rhel -U true | Oracle Linux 8.9 | UEFI | +| ./proxmox_generic.sh -V oraclelinux89 -F rhel -U false | Oracle Linux 8.9 | BIOS | +| ./proxmox_generic.sh -V oraclelinux92 -F rhel -U true | Oracle Linux 9.2 | UEFI | +| ./proxmox_generic.sh -V oraclelinux92 -F rhel -U false | Oracle Linux 9.2 | BIOS | +| ./proxmox_generic.sh -V oraclelinux93 -F rhel -U true | Oracle Linux 9.3 | UEFI | +| ./proxmox_generic.sh -V oraclelinux93 -F rhel -U false | Oracle Linux 9.3 | BIOS | +| ./proxmox_generic.sh -V oraclelinux94 -F rhel -U true | Oracle Linux 9.4 | UEFI | +| ./proxmox_generic.sh -V oraclelinux94 -F rhel -U false | Oracle Linux 9.4 | BIOS | +| ./proxmox_generic.sh -V rockylinux810 -F rhel -U true | Rocky Linux 8.10 | UEFI | +| ./proxmox_generic.sh -V rockylinux810 -F rhel -U false | Rocky Linux 8.10 | BIOS | +| ./proxmox_generic.sh -V rockylinux88 -F rhel -U true | Rocky Linux 8.8 | UEFI | +| ./proxmox_generic.sh -V rockylinux88 -F rhel -U false | Rocky Linux 8.8 | BIOS | +| ./proxmox_generic.sh -V rockylinux89 -F rhel -U true | Rocky Linux 8.9 | UEFI | +| ./proxmox_generic.sh -V rockylinux89 -F rhel -U false | Rocky Linux 8.9 | BIOS | +| ./proxmox_generic.sh -V rockylinux92 -F rhel -U true | Rocky Linux 9.2 | UEFI | +| ./proxmox_generic.sh -V rockylinux92 -F rhel -U false | Rocky Linux 9.2 | BIOS | +| ./proxmox_generic.sh -V rockylinux93 -F rhel -U true | Rocky Linux 9.3 | UEFI | +| ./proxmox_generic.sh -V rockylinux93 -F rhel -U false | Rocky Linux 9.3 | BIOS | +| ./proxmox_generic.sh -V rockylinux94 -F rhel -U true | Rocky Linux 9.4 | UEFI | +| ./proxmox_generic.sh -V rockylinux94 -F rhel -U false | Rocky Linux 9.4 | BIOS | +| ./proxmox_generic.sh -V ubuntu2204 -F ubuntu -U true | Ubuntu 22.04 | UEFI | +| ./proxmox_generic.sh -V ubuntu2204 -F ubuntu -U false | Ubuntu 22.04 | BIOS | +| ./proxmox_generic.sh -V ubuntu2304 -F ubuntu -U true | Ubuntu 23.04 | UEFI | +| ./proxmox_generic.sh -V ubuntu2304 -F ubuntu -U false | Ubuntu 23.04 | BIOS | +| ./proxmox_generic.sh -V ubuntu2404 -F ubuntu -U true | Ubuntu 24.04 | UEFI | +| ./proxmox_generic.sh -V ubuntu2404 -F ubuntu -U false | Ubuntu 24.04 | BIOS | +| ./proxmox_generic.sh -V windows2019-dc -F windows -U true | Windows Server 2019 Datacenter | UEFI | +| ./proxmox_generic.sh -V windows2019-dc -F windows -U false | Windows Server 2019 Datacenter | BIOS | +| ./proxmox_generic.sh -V windows2019-std -F windows -U true | Windows Server 2019 Standard | UEFI | +| ./proxmox_generic.sh -V windows2019-std -F windows -U false | Windows Server 2019 Standard | BIOS | +| ./proxmox_generic.sh -V windows2022-dc -F windows -U true | Windows Server 2022 Datacenter | UEFI | +| ./proxmox_generic.sh -V windows2022-dc -F windows -U false | Windows Server 2022 Datacenter | BIOS | +| ./proxmox_generic.sh -V windows2022-std -F windows -U true | Windows Server 2022 Standard | UEFI | +| ./proxmox_generic.sh -V windows2022-std -F windows -U false | Windows Server 2022 Standard | BIOS | + | OS | script | Comments| |----|--------|---------| @@ -153,6 +214,16 @@ example: - For Windows-based machines provisioning is done by Powershell scripts located in `extra/scripts/windows/*` +### Updates + +In case of RHEL clones, only current release is allowed to do updates, as updating for example Alma Linux 8.8 will always end in current release (8.10). This is due to the way how RHEL clones are built. To avoid that, all updates in NON current releases are disabled by setting extra variable for ansible playbook `install_updates: false` + +```ini +ansible_extra_args = ["-e", "@extra/playbooks/provision_rocky8_variables.yml", "-e", "@variables/rockylinux8.yml", "-e", "{\"install_updates\": false}","--scp-extra-args", "'-O'"] +``` + +if you really want to start from historical release and update it to current release, remove `"-e","{\"install_updates\": false}"` from `ansible_extra_args` variable + ## KVM ### KVM Requirements diff --git a/extra/files/opensuse_leap/15/proxmox/autoinst.xml b/extra/files/opensuse_leap/15/proxmox/bios/autoinst.xml similarity index 100% rename from extra/files/opensuse_leap/15/proxmox/autoinst.xml rename to extra/files/opensuse_leap/15/proxmox/bios/autoinst.xml diff --git a/extra/files/opensuse_leap/15/proxmox/uefi/autoinst.xml b/extra/files/opensuse_leap/15/proxmox/uefi/autoinst.xml new file mode 100644 index 0000000..169df3e --- /dev/null +++ b/extra/files/opensuse_leap/15/proxmox/uefi/autoinst.xml @@ -0,0 +1,1345 @@ + + + + + + + repo-backports-update + http://download.opensuse.org/update/leap/15.5/backports/ + Update repository of openSUSE Backports + 99 + / + + + repo-non-oss + http://download.opensuse.org/distribution/leap/15.5/repo/non-oss/ + Non-OSS Repository + 99 + / + + + repo-openh264 + http://codecs.opensuse.org/openh264/openSUSE_Leap/ + Open H.264 Codec (openSUSE Leap) + 99 + + + + repo-sle-update + http://download.opensuse.org/update/leap/15.5/sle/ + Update repository with updates from SUSE Linux Enterprise 15 + 99 + / + + + repo-update + http://download.opensuse.org/update/leap/15.5/oss + Main Update Repository + 99 + / + + + repo-update-non-oss + http://download.opensuse.org/update/leap/15.5/non-oss/ + Update Repository (Non-Oss) + 99 + / + + + + + + splash=silent preempt=full mitigations=auto quiet security=apparmor + auto + auto + false + true + true + gfxterm + 8 + true + vga=gfx-1024x768x16 + + grub2-efi + + + public + true + off + true + + + Unsolicited incoming network packets are rejected. Incoming packets that are related to outgoing network connections are accepted. Outgoing network connections are allowed. + + false + block + + + + Block + %%REJECT%% + + + For computers in your demilitarized zone that are publicly-accessible with limited access to your internal network. Only selected incoming connections are accepted. + + false + dmz + + + + ssh + + DMZ + default + + + All network connections are accepted. + + docker0 + + false + docker + + + + docker + ACCEPT + + + Unsolicited incoming network packets are dropped. Incoming packets that are related to outgoing network connections are accepted. Outgoing network connections are allowed. + + false + drop + + + + Drop + DROP + + + For use on external networks. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted. + + true + external + + + + ssh + + External + default + + + For use in home areas. You mostly trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted. + + false + home + + + + dhcpv6-client + mdns + samba-client + ssh + + Home + default + + + For use on internal networks. You mostly trust the other computers on the networks to not harm your computer. Only selected incoming connections are accepted. + + false + internal + + + + dhcpv6-client + mdns + samba-client + ssh + + Internal + default + + + For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted. + + eth0 + + false + public + + + + dhcpv6-client + ssh + + Public + default + + + All network connections are accepted. + + false + trusted + + + + Trusted + ACCEPT + + + For use in work areas. You mostly trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted. + + false + work + + + + dhcpv6-client + ssh + + Work + default + + + + + + false + false + + + + + 100 + users + + + + 491 + cdrom + + + + 487 + render + + + + 475 + polkitd + + + + 5 + tty + + + + 479 + systemd-journal + + + + 473 + sshd + + + + 62 + man + + + + 51 + postfix + + + + 492 + audio + + + + 485 + tape + + + + 480 + chrony + + + + 494 + lock + + + + 493 + utmp + + + + 0 + root + + + + 486 + sgx + + + + 496 + wheel + + + + 476 + nscd + + + + 2 + daemon + + + + 1 + bin + daemon + + + 484 + video + + + + 42 + trusted + + + + 474 + rtkit + + + + 59 + maildrop + postfix + + + 489 + disk + + + + 495 + kmem + + + + 488 + input + + + + 497 + lp + + + + 478 + systemd-network + + + + 36 + kvm + + + + 499 + messagebus + + + + 15 + shadow + + + + 498 + mail + postfix + + + 482 + wsdd + + + + 483 + audit + + + + 65533 + nogroup + + + + 65534 + nobody + + + + 71 + ntadmin + + + + 490 + dialout + + + + 477 + systemd-timesync + + + + 481 + srvGeoClue + + + + + + + 127.0.0.1 + + localhost + + + + ::1 + + localhost ipv6-localhost ipv6-loopback + + + + fe00::0 + + ipv6-localnet + + + + ff00::0 + + ipv6-mcastprefix + + + + ff02::1 + + ipv6-allnodes + + + + ff02::2 + + ipv6-allrouters + + + + ff02::3 + + ipv6-allhosts + + + + + + + + AUTO + + + true + opensuse15 + auto + + + + dhcp + eth0 + auto + public + + + true + true + false + + false + false + + + + auto + false + false + + false + + + + + false + false + + + auto + + systemd + + + + + true + gpt + true + + + true + vfat + true + utf8 + /boot/efi + uuid + 259 + 1 + false + 536870912 + + + true + true + btrfs + true + / + uuid + 131 + 2 + true + true + max + + + false + var + + + true + usr/local + + + true + tmp + + + true + srv + + + true + root + + + true + opt + + + true + home + + + true + boot/grub2/x86_64-efi + + + true + boot/grub2/i386-pc + + + @ + + + true + swap + true + swap + uuid + 130 + 3 + false + 2148515328 + + + CT_DISK + all + + + + + + + + + Order allow,deny + + +# Restrict access to the admin pages... + + Order allow,deny + + +# Restrict access to configuration files... + + AuthType Default + Require user @SYSTEM + Order allow,deny + + +# Restrict access to log files... + + AuthType Default + Require user @SYSTEM + Order allow,deny + + +# Set the default printer/job policies... + + # Job/subscription privacy... + JobPrivateAccess default + JobPrivateValues default + SubscriptionPrivateAccess default + SubscriptionPrivateValues default + + # Job-related operations must be done by the owner or an administrator... + + Order deny,allow + + + + Require user @OWNER @SYSTEM + Order deny,allow + + + # Require authentication for CUPS-Get-Document otherwise unauthenticated users could access print job documents: + + AuthType Default + Require user @OWNER @SYSTEM + Order deny,allow + + + # All administration operations require an administrator to authenticate... + + AuthType Default + Require user @SYSTEM + Order deny,allow + + + # All printer operations require a printer operator to authenticate... + + AuthType Default + Require user @SYSTEM + Order deny,allow + + + # Only the owner or an administrator can cancel or authenticate a job... + + Require user @OWNER @SYSTEM + Order deny,allow + + + + Order deny,allow + + + +# Set the authenticated printer/job policies... + + # Job/subscription privacy... + JobPrivateAccess default + JobPrivateValues default + SubscriptionPrivateAccess default + SubscriptionPrivateValues default + + # Job-related operations must be done by the owner or an administrator... + + AuthType Default + Order deny,allow + + + + AuthType Default + Require user @OWNER @SYSTEM + Order deny,allow + + + # All administration operations require an administrator to authenticate... + + AuthType Default + Require user @SYSTEM + Order deny,allow + + + # All printer operations require a printer operator to authenticate... + + AuthType Default + Require user @SYSTEM + Order deny,allow + + + # Only the owner or an administrator can cancel or authenticate a job... + + AuthType Default + Require user @OWNER @SYSTEM + Order deny,allow + + + + Order deny,allow + + + +# Set the kerberized printer/job policies... + + # Job/subscription privacy... + JobPrivateAccess default + JobPrivateValues default + SubscriptionPrivateAccess default + SubscriptionPrivateValues default + + # Job-related operations must be done by the owner or an administrator... + + AuthType Negotiate + Order deny,allow + + + + AuthType Negotiate + Require user @OWNER @SYSTEM + Order deny,allow + + + # All administration operations require an administrator to authenticate... + + AuthType Default + Require user @SYSTEM + Order deny,allow + + + # All printer operations require a printer operator to authenticate... + + AuthType Default + Require user @SYSTEM + Order deny,allow + + + # Only the owner or an administrator can cancel or authenticate a job... + + AuthType Negotiate + Require user @OWNER @SYSTEM + Order deny,allow + + + + Order deny,allow + + + +# The policy below is added by SUSE during build of our cups package. +# The policy 'allowallforanybody' is totally open and insecure and therefore +# it can only be used within an internal network where only trused users exist +# and where the cupsd is not accessible at all from any external host, see +# http://en.opensuse.org/SDB:CUPS_and_SANE_Firewall_settings +# Have in mind that any user who is allowed to do printer admin tasks +# can change the print queues as he likes - e.g. send copies of confidental +# print jobs from an internal network to any external destination, see +# http://en.opensuse.org/SDB:CUPS_in_a_Nutshell +# For documentation regarding 'Managing Operation Policies' see +# https://openprinting.github.io/cups/doc/policies.html + + # Allow anybody to access job's private values: + JobPrivateAccess all + # Make none of the job values to be private: + JobPrivateValues none + # Allow anybody to access subscription's private values: + SubscriptionPrivateAccess all + # Make none of the subscription values to be private: + SubscriptionPrivateValues none + # Allow anybody to do all IPP operations: + # Currently the IPP operations Validate-Job Cancel-Jobs Cancel-My-Jobs Close-Job CUPS-Get-Document + # must be additionally exlicitly specified because those IPP operations are not included + # in the "All" wildcard value - otherwise cupsd prints error messages of the form + # "No limit for Validate-Job defined in policy allowallforanybody and no suitable template found." + + Order deny,allow + Allow from all + + # Since CUPS > 1.5.4 the "All" wildcard value must be specified separately, + # otherwise clients like "lpstat -p" just hang up, + # see https://bugzilla.opensuse.org/show_bug.cgi?id=936309 + # and https://www.cups.org/str.php?L4659 + + Order deny,allow + Allow from all + + +# Explicitly set the CUPS 'default' policy to be used by default: +DefaultPolicy default + +]]> + + + + false + + + multi-user + + + YaST2-Firstboot + YaST2-Second-Stage + apparmor + auditd + klog + chronyd + cron + cups + firewalld + wickedd-auto4 + wickedd-dhcp4 + wickedd-dhcp6 + wickedd-nanny + irqbalance + issue-generator + kbdsettings + lvm2-monitor + mcelog + wicked + nscd + postfix + purge-kernels + rsyslog + smartd + sshd + systemd-pstore + systemd-remount-fs + + + + + true + + + wicked + snapper + shim + os-prober + openssh + openSUSE-release + numactl + mokutil + mc + kexec-tools + irqbalance + grub2-x86_64-efi + glibc + firewalld + e2fsprogs + dosfstools + chrony + btrfsprogs + autoyast2 + + + apparmor + base + documentation + enhanced_base + minimal_base + sw_management + x11_yast + yast2_basis + yast2_desktop + yast2_server + + + Leap + + + + false + false + + + Etc/UTC + + + english-us + + + en_US + + + + 100 + /home + -1 + /bin/bash + 022 + + + + + true + root + 0 + /root + false + + + + + + + + + /bin/bash + 0 + $6$DJ5FbdUInEoPzTOo$bBMRfGTs5x5Ei9xTPK7yNv.s0abMD.E1bHYyo6xpzws1C8L/hGCHvyF.A.yOk0ic/wCZSrIeV.guzSTThbHJ6/ + root + + + true + Daemon + 2 + /sbin + false + + + + + + + + + /usr/sbin/nologin + 2 + ! + daemon + + + true + User for nscd + 476 + /run/nscd + false + + + + + + + + + /sbin/nologin + 476 + ! + nscd + + + true + systemd Time Synchronization + 477 + / + false + + + + + + + + + /usr/sbin/nologin + 477 + !* + systemd-timesync + + + true + User for GeoClue D-Bus service + 481 + /var/lib/srvGeoClue + false + + + + + + + + + /usr/sbin/nologin + 495 + ! + srvGeoClue + + + true + bin + 1 + /bin + false + + + + + + + + + /usr/sbin/nologin + 1 + ! + bin + + + true + RealtimeKit + 474 + /proc + false + + + + + + + + + /bin/false + 474 + ! + rtkit + + + true + NFS statd daemon + 65533 + /var/lib/nfs + false + + + + + + + + + /sbin/nologin + 471 + ! + statd + + + true + User for D-Bus + 499 + /run/dbus + false + + + + + + + + + /usr/bin/false + 499 + ! + messagebus + + + true + SSH daemon + 473 + /var/lib/sshd + false + + + + + + + + + /usr/sbin/nologin + 473 + ! + sshd + + + true + Manual pages viewer + 62 + /var/lib/empty + false + + + + + + + + + /usr/sbin/nologin + 13 + ! + man + + + true + Postfix Daemon + 51 + /var/spool/postfix + false + + + + + + + + + /usr/sbin/nologin + 51 + ! + postfix + + + true + user for rpcbind + 65534 + /var/lib/empty + false + + + + + + + + + /sbin/nologin + 472 + ! + rpc + + + true + Mailer daemon + 498 + /var/spool/clientmqueue + false + + + + + + + + + /usr/sbin/nologin + 498 + ! + mail + + + true + User for wsdd + 482 + /run/wsdd + false + + + + + + + + + /usr/sbin/nologin + 496 + ! + wsdd + + + true + User for polkitd + 475 + /var/lib/polkit + false + + + + + + + + + /usr/sbin/nologin + 475 + ! + polkitd + + + true + Printing daemon + 497 + /var/spool/lpd + false + + + + + + + + + /usr/sbin/nologin + 497 + ! + lp + + + true + systemd Network Management + 478 + / + false + + + + + + + + + /usr/sbin/nologin + 478 + !* + systemd-network + + + true + nobody + 65534 + /var/lib/nobody + false + + + + + + + + + /bin/bash + 65534 + ! + nobody + + + true + Chrony Daemon + 480 + /var/lib/chrony + false + + + + + + + + + /usr/sbin/nologin + 494 + ! + chrony + + + diff --git a/extra/files/oraclelinux/8/proxmox/ks.cfg b/extra/files/oraclelinux/8/proxmox/ks.cfg index 77d2c7c..cf0ac7a 100644 --- a/extra/files/oraclelinux/8/proxmox/ks.cfg +++ b/extra/files/oraclelinux/8/proxmox/ks.cfg @@ -39,16 +39,10 @@ zerombr # Partition clearing information clearpart --all --initlabel # Disk partitioning information - -#Disk partitioning information +part /boot/efi --fstype="vfat" --size=400 part /boot --fstype="ext4" --size=2048 -part swap --fstype="swap" --size=8192 - -part pv.01 --size=1 --grow -volgroup vg_root pv.01 -logvol / --vgname=vg_root --size=1 --grow --name=lv_root -logvol /var --vgname=vg_root --size=8192 --name=lv_var - +part swap --fstype="swap" --size=8192 +part / --fstype="ext4" --grow --size=1 %packages @guest-agents diff --git a/extra/files/redhat/7/ks-kvm-uefi.cfg b/extra/files/redhat/7/ks-kvm-uefi.cfg new file mode 100644 index 0000000..da5e49f --- /dev/null +++ b/extra/files/redhat/7/ks-kvm-uefi.cfg @@ -0,0 +1,104 @@ +lang en_US +keyboard us +# Root password +rootpw $1$f0Hr84$whurdRGVEJbZs8QJJoWLB. --iscrypted +# Use network installation +#url --url="http://mirror.centos.org/centos/7/os/x86_64" +# Use cdrom +cdrom +# System language +# Firewall configuration +firewall --disabled +# +# System authorization information +auth --passalgo=sha512 --useshadow +# Use graphical install +# graphical +# Use text install +text +# Run the Setup Agent on first boot +firstboot --disable +# SELinux configuration +selinux --disabled +# License agreement +eula --agreed + +#X-window +skipx + +# System services +services --enabled="chronyd" +services --enabled="sshd" +services --enabled="NetworkManager" + +# Network information +network --bootproto=dhcp --noipv6 --activate +# Reboot after installation +reboot +# System timezone +timezone Etc/UTC --isUtc +# System bootloader configuration +bootloader --append="rhgb quiet crashkernel=auto" +# Clear the Master Boot Record +zerombr +# Partition clearing information +clearpart --all --initlabel +# # Disk partitioning information +part /boot/efi --fstype="efi" --size=200 --fsoptions="umask=0077,shortname=winnt" +part /boot --fstype="ext4" --size=2048 +part pv.01 --size=1 --grow +volgroup vg_root pv.01 +logvol swap --vgname=vg_root --size=8192 --name=lv_swap +logvol / --vgname=vg_root --size=1 --grow --name=lv_root + +# part /boot --fstype="ext4" --size=2048 +# part swap --fstype="swap" --size=8192 +# part pv.01 --size=1 --grow +# volgroup vg_root pv.01 +# logvol / --vgname=vg_root --size=1 --grow --name=lv_root +# logvol /var --vgname=vg_root --size=8192 --name=lv_var + +# pre part +%pre + +%end + +# post part +%post --log=/var/log/anaconda/kickstart_post.log +systemctl enable sshd +# systemctl start sshd +systemctl set-default multi-user.target +systemctl disable initial-setup-text +systemctl disable initial-setup-graphical +sed -i 's/__all__ = \["EULAspoke"\]/__all__ = \["LicenseScreen"\]/' /usr/lib/python2.7/site-packages/initial_setup/tui/spokes/eula.py +%end + +%packages +@base +@compat-libraries +@core +@guest-agents +@input-methods +@network-file-system-client +@performance +chrony +mc +curl +wget +yum-versionlock +yum-utils +yum-cron +openssh-server +openssh-clients +openssh +kernel-devel +kernel-headers +make +patch +gcc +spice-vdagent +cloud-init +cloud-utils-growpart +gdb +git +%end diff --git a/extra/files/gen2-rhel7/ks-kvm.cfg b/extra/files/redhat/7/ks-kvm.cfg similarity index 100% rename from extra/files/gen2-rhel7/ks-kvm.cfg rename to extra/files/redhat/7/ks-kvm.cfg diff --git a/extra/files/oraclelinux/8/proxmox/ks.cfg.bak b/extra/files/redhat/8/ks-kvm-uefi.cfg similarity index 57% rename from extra/files/oraclelinux/8/proxmox/ks.cfg.bak rename to extra/files/redhat/8/ks-kvm-uefi.cfg index de1e2d7..e377a71 100644 --- a/extra/files/oraclelinux/8/proxmox/ks.cfg.bak +++ b/extra/files/redhat/8/ks-kvm-uefi.cfg @@ -1,6 +1,5 @@ #version=RHEL8 # X Window System configuration information -xconfig --startxonboot # License agreement eula --agreed # Use graphical install @@ -8,10 +7,9 @@ text # SELinux configuration selinux --disabled # Network information -#network --bootproto=dhcp --noipv6 --activate -#network --bootproto=dhcp --hostname=localhost.localdomain - -ignoredisk --only-use=sda +network --bootproto=dhcp --noipv6 --activate +# firewall +firewall --disabled # Use CDROM installation media cdrom # Run the Setup Agent on first boot @@ -28,26 +26,28 @@ lang en_US --addsupport=en_GB.UTF-8 repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream # Root password -rootpw --iscrypted $6$kivIgMEEjORaheG3$MTEQUVvZE0744qxUdXrSXfs/ePGYOVNGJv9aXVUyXRCiX3oizj69RF5Rw17npKPiltKgdepk0yO8/gzJQ2Se6/ +rootpw --plaintext password # System timezone -timezone Europe/Warsaw --isUtc --ntpservers=0.rhel.pool.ntp.org +timezone UTC --isUtc --ntpservers=0.rhel.pool.ntp.org # System bootloader configuration -bootloader --location=mbr --boot-drive=sda -#autopart --type=lvm +bootloader zerombr # Partition clearing information clearpart --all --initlabel -# Disk partitioning information -part /boot/efi --fstype="vfat" --size=200 -part /boot --fstype="ext4" --size=1024 -part swap --fstype="swap" --size=16384 -part / --fstype="ext4" --grow --size=1 +# # Disk partitioning information +part /boot/efi --fstype="efi" --size=200 --fsoptions="umask=0077,shortname=winnt" +part /boot --fstype="ext4" --size=2048 +part pv.01 --size=1 --grow +volgroup vg_root pv.01 +logvol swap --vgname=vg_root --size=8192 --name=lv_swap +logvol / --vgname=vg_root --size=1 --grow --name=lv_root + %packages @guest-agents -@headless-management @legacy-unix @system-tools +bash mc curl wget @@ -55,7 +55,6 @@ tar bzip2 kernel-devel kernel-headers -kernel-uek-devel perl gcc git @@ -66,6 +65,15 @@ glibc-all-langpacks openssh-server openssh-clients openssh +python3-pip +python3-setuptools +tuned +tuned-profiles-atomic +tuned-utils +spice-vdagent +qemu-guest-agent +cloud-init +cloud-utils-growpart %end %addon com_redhat_subscription_manager @@ -82,17 +90,16 @@ pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty %end # post part -%post +%post --log=/var/log/anaconda/kickstart_post_sshd.log +sed -ri 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config +sed -ri 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config +sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config systemctl enable sshd +%end + +%post --log=/var/log/anaconda/kickstart_post.log +systemctl enable qemu-guest-agent systemctl set-default multi-user.target -systemctl disable initial-setup-text -systemctl disable initial-setup-graphical -initial_setup/tui/spokes/eula.py -# -cp -pr /boot/efi/EFI/almalinux/* /boot/efi/EFI/BOOT/ -# delete libvirt -systemctl stop libvirtd -systemctl disable libvirtd %end #reboot diff --git a/extra/files/gen2-rhel7/ks-kvm8.cfg b/extra/files/redhat/8/ks-kvm.cfg similarity index 100% rename from extra/files/gen2-rhel7/ks-kvm8.cfg rename to extra/files/redhat/8/ks-kvm.cfg diff --git a/extra/files/ubuntu/24.04/hyperv/meta-data b/extra/files/ubuntu/24.04/hyperv/meta-data new file mode 100644 index 0000000..e69de29 diff --git a/extra/files/ubuntu/24.04/hyperv/user-data b/extra/files/ubuntu/24.04/hyperv/user-data new file mode 100644 index 0000000..12ba14c --- /dev/null +++ b/extra/files/ubuntu/24.04/hyperv/user-data @@ -0,0 +1,109 @@ +#cloud-config + +autoinstall: + version: 1 + early-commands: + - systemctl stop ssh # otherwise packer tries to connect and exceed max attempts + network: + network: + version: 2 + ethernets: + eth0: + dhcp4: yes + dhcp-identifier: mac + update: no + apt: + geoip: true + preserve_sources_list: false + primary: + - arches: [amd64] + uri: "http://archive.ubuntu.com/ubuntu/" + packages: + - mc + - curl + - wget + - sudo + - tar + - bzip2 + - build-essential + - linux-image-virtual + - linux-tools-virtual + - net-tools + - qemu-guest-agent + locale: en_US.UTF-8 + timezone: Europe/Copenhagen + ssh: + install-server: true + allow-pw: true + user-data: + disable_root: false +# lock-passwd: false + ssh_pwauth: true + hostname: ubuntu2404 +# username: root + chpasswd: + expire: false + users: + - name: root + password: password + type: text + - name: ubuntu + password: password + type: text + late-commands: + #- echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu + - sed -ie 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX="net.ifnames=0 ipv6.disable=1 biosdevname=0"/' /target/etc/default/grub + - sed -ie 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /target/etc/ssh/sshd_config + - sed -ie 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /target/etc/ssh/sshd_config + - sed -ie 's/#AllowAgentForwarding yes/AllowAgentForwarding yes/' /target/etc/ssh/sshd_config + - curtin in-target -- update-grub2 + # virtual package is required for some cloud images. Lack of it causes failure in communication. + - curtin in-target -- apt-get -y install linux-cloud-tools-virtual||true + - curtin in-target -- systemctl enable qemu-guest-agent + storage: + config: + - type: disk + id: disk0 + ptable: gpt + wipe: superblock + grub_device: true + match: + size: largest + - id: efi-partition # create partitions on disk (like sda1) + type: partition + device: disk0 + size: 512MB + flag: boot # EFI system partition needs boot flag + - type: partition + id: boot-partition + device: disk0 + size: 2GB + - type: partition + device: disk0 + id: root-partition + size: -1 + - id: efi-partition-fs # format partitions on disk + type: format + volume: efi-partition + fstype: fat32 + label: EFI + - id: boot-partition-fs + type: format + fstype: ext4 + volume: boot-partition + - id: root-partition-fs + type: format + fstype: ext4 + volume: root-partition + - id: efi-partition-fs-mount # mount partitions + type: mount + device: efi-partition-fs + path: /boot/efi + - id: root-partition-fs-mount + type: mount + path: / + device: root-partition-fs + - id: boot-partition-fs-mount + type: mount + path: /boot + device: boot-partition-fs diff --git a/extra/files/ubuntu/24.04/proxmox-uefi/meta-data b/extra/files/ubuntu/24.04/proxmox-uefi/meta-data new file mode 100644 index 0000000..e69de29 diff --git a/extra/files/ubuntu/24.04/proxmox-uefi/user-data b/extra/files/ubuntu/24.04/proxmox-uefi/user-data new file mode 100644 index 0000000..7f367e5 --- /dev/null +++ b/extra/files/ubuntu/24.04/proxmox-uefi/user-data @@ -0,0 +1,109 @@ +#cloud-config + +autoinstall: + version: 1 + early-commands: + - systemctl stop ssh # otherwise packer tries to connect and exceed max attempts + network: + network: + version: 2 + ethernets: + eth0: + dhcp4: yes + dhcp-identifier: mac + update: no + apt: + geoip: true + preserve_sources_list: false + primary: + - arches: [amd64] + uri: "http://archive.ubuntu.com/ubuntu/" + packages: + - mc + - curl + - wget + - sudo + - tar + - bzip2 + - build-essential + - linux-image-virtual + - linux-tools-virtual + - net-tools + - qemu-guest-agent + locale: en_US.UTF-8 + timezone: Europe/Copenhagen + ssh: + install-server: true + allow-pw: true + user-data: + disable_root: false +# lock-passwd: false + ssh_pwauth: true + hostname: ubuntu2404 +# username: root + chpasswd: + expire: false + users: + - name: root + password: password + type: text + - name: ubuntu + password: password + type: text + late-commands: + #- echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu + - sed -ie 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX="net.ifnames=0 ipv6.disable=1 biosdevname=0"/' /target/etc/default/grub + - sed -ie 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /target/etc/ssh/sshd_config + - sed -ie 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /target/etc/ssh/sshd_config + - sed -ie 's/#AllowAgentForwarding yes/AllowAgentForwarding yes/' /target/etc/ssh/sshd_config + - curtin in-target -- update-grub2 + # virtual package is required for some cloud images. Lack of it causes failure in communication. + - curtin in-target -- apt-get -y install linux-cloud-tools-virtual||true + - curtin in-target -- systemctl enable qemu-guest-agent + storage: + config: + - type: disk + id: disk0 + ptable: gpt + wipe: superblock + grub_device: true + match: + size: largest + - id: efi-partition + type: partition + device: disk0 + size: 512MB + flag: boot + grub_device: true + - id: boot-partition + type: partition + device: disk0 + size: 2GB + - id: root-partition + type: partition + device: disk0 + size: -1 + - id: efi-partition-fs + type: format + fstype: fat32 + volume: efi-partition + - id: boot-partition-fs + type: format + fstype: ext4 + volume: boot-partition + - id: root-partition-fs + type: format + fstype: ext4 + volume: root-partition + - id: efi-partition-fs-mount + type: mount + path: /boot/efi + device: efi-partition-fs + - id: boot-partition-fs-mount + type: mount + path: /boot + device: boot-partition-fs + - id: root-partition-fs-mount + type: mount + path: / + device: root-partition-fs diff --git a/extra/files/ubuntu/24.04/uefi.sh b/extra/files/ubuntu/24.04/uefi.sh new file mode 100644 index 0000000..16dc624 --- /dev/null +++ b/extra/files/ubuntu/24.04/uefi.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# try to deal with broken centos/ubuntu UEFI in Hyper-V + +# Let's find out which bootnumber we have currently in UEFI with Ubuntu label +bootnum=$(efibootmgr -v|grep -i ubuntu|awk '{print $1}'|cut -c5-8) + +if [ -d "/boot/efi/EFI/ubuntu" ]; then + echo "Ubuntu exists" + # now centos exists + if [ -z "$bootnum" ]; then + echo "Current Ubuntu boot number equals: $bootnum" + efibootmgr -b "$bootnum" -B + efibootmgr --create --label Ubuntu --disk /dev/sda1 --loader "\EFI\ubuntu\shim.efi" + sudo grub2-mkconfig -o /boot/efi/EFI/BOOT/grub.cfg + efibootmgr -v + fi +fi diff --git a/extra/playbooks/provision_alma8_variables.yml b/extra/playbooks/provision_alma8_variables.yml index 3e14de9..8810efc 100644 --- a/extra/playbooks/provision_alma8_variables.yml +++ b/extra/playbooks/provision_alma8_variables.yml @@ -136,3 +136,9 @@ kernel_parameters: - key: "systemd.unified_cgroup_hierarchy" value: "1" state: present +gpgkey: + - url: https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux + state: present + - url: https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux-8 + state: present + diff --git a/extra/playbooks/provision_rhel.yaml b/extra/playbooks/provision_rhel.yaml index 2410a83..adca8e9 100644 --- a/extra/playbooks/provision_rhel.yaml +++ b/extra/playbooks/provision_rhel.yaml @@ -17,7 +17,7 @@ delay_time: 15 retries_count: 2 reboot_server: false - playbook_version: "20240404" + playbook_version: "20240612" become: true gather_facts: false pre_tasks: @@ -69,8 +69,18 @@ - "Install Webmin :{{ install_webmin | lower }}" - "Reboot server :{{ reboot_server | lower }}" - "Playbook version :{{ playbook_version }}" - # initial cleaning and refreshing metadata for packages + - name: Initial GPG Keys update + ansible.builtin.rpm_key: + key: "{{ item.url }}" + state: "{{ item.state | default('present') }}" + loop: "{{ gpgkey }}" + retries: "{{ retries_count }}" + delay: "{{ delay_time }}" + register: r_initial_gpg_keys + until: r_initial_gpg_keys is success + when: gpgkey is defined and gpgkey | length > 0 + failed_when: false - name: initial_clean ansible.builtin.debug: msg: "Starting provision" @@ -78,6 +88,8 @@ - clean-metadata - makecache changed_when: false + - name: Flush handlers + ansible.builtin.meta: flush_handlers - name: install_initial_packages ansible.builtin.package: name: "{{ item }}" @@ -703,7 +715,7 @@ warn: false changed_when: false - name: clean-metadata - ansible.builtin.command: "{{ ansible_pkg_mgr }} clean metadata all -y" + ansible.builtin.command: "{{ ansible_pkg_mgr }} clean all -y" args: warn: false changed_when: false diff --git a/proxmox/proxmox_rhel.pkr.hcl b/proxmox/proxmox_rhel.pkr.hcl index c48fb2e..e894613 100644 --- a/proxmox/proxmox_rhel.pkr.hcl +++ b/proxmox/proxmox_rhel.pkr.hcl @@ -162,8 +162,40 @@ variable "qemu_agent" { default = true } +variable "efi_storage_pool" { + type = string + default = "local" +} + +variable "pre_enrolled_keys" { + type = bool + default = false +} + +variable "efi_type" { + type = string + default = "4m" +} + +variable "bios" { + type = string + default = "seabios" +} + +variable "use_efi" { + type = bool + default = false +} +variable "machine" { + type = string + default = "pc" +} +variable "tags" { + type = string + default = "bios;template" +} locals { packer_timestamp = formatdate("YYYYMMDD-hhmm", timestamp()) @@ -173,6 +205,7 @@ source "proxmox-iso" "linux" { ballooning_minimum = "${var.ballooning_minimum}" boot_command = ["${var.boot_command}"] boot_wait = "${var.boot_wait}" + bios = "${var.bios}" cores = "${var.cores}" cpu_type = "${var.cpu_type}" disable_kvm = "${var.disable_kvm}" @@ -188,6 +221,7 @@ source "proxmox-iso" "linux" { http_directory = "${path.cwd}/extra/files" insecure_skip_tls_verify = true iso_file = "${var.iso_file}" + machine = "${var.machine}" memory = "${var.memory}" network_adapters { bridge = "${var.network_adapters.bridge}" @@ -205,37 +239,90 @@ source "proxmox-iso" "linux" { ssh_port = "${var.ssh_port}" ssh_timeout = "10000s" ssh_username = "${var.ssh_username}" + tags = "${var.tags}" task_timeout = "${var.task_timeout}" template_name = "${var.template}.${local.packer_timestamp}" token = "${var.proxmox_token}" unmount_iso = true username = "${var.proxmox_username}" +} +source "proxmox-iso" "linux-efi" { + ballooning_minimum = "${var.ballooning_minimum}" + boot_command = ["${var.boot_command}"] + boot_wait = "${var.boot_wait}" + bios = "${var.bios}" + cores = "${var.cores}" + cpu_type = "${var.cpu_type}" + disable_kvm = "${var.disable_kvm}" + disks { + cache_mode = "${var.disks.cache_mode}" + disk_size = "${var.disks.disk_size}" + format = "${var.disks.format}" + storage_pool = "${var.disks.storage_pool}" + type = "${var.disks.type}" + io_thread = "${var.disks.io_thread}" + discard = "${var.disks.discard}" + } + efi_config { + efi_storage_pool = "${var.efi_storage_pool}" + efi_type = "${var.efi_type}" + pre_enrolled_keys = "${var.pre_enrolled_keys}" + } + http_directory = "${path.cwd}/extra/files" + insecure_skip_tls_verify = true + iso_file = "${var.iso_file}" + machine = "${var.machine}" + memory = "${var.memory}" + network_adapters { + bridge = "${var.network_adapters.bridge}" + model = "${var.network_adapters.model}" + firewall = "${var.network_adapters.firewall}" + mac_address = "${var.network_adapters.mac_address}" + } + node = "${var.proxmox_node}" + os = "${var.os}" + proxmox_url = "${var.proxmox_url}" + qemu_agent = "${var.qemu_agent}" + scsi_controller = "${var.scsi_controller}" + sockets = "${var.sockets}" + ssh_password = "${var.ssh_password}" + ssh_port = "${var.ssh_port}" + ssh_timeout = "10000s" + ssh_username = "${var.ssh_username}" + tags = "${var.tags}" + task_timeout = "${var.task_timeout}" + template_name = "${var.template}.${local.packer_timestamp}" + token = "${var.proxmox_token}" + unmount_iso = true + username = "${var.proxmox_username}" } build { - sources = ["source.proxmox-iso.linux"] + sources = [ + var.use_efi ? "source.proxmox-iso.linux-efi" : "source.proxmox-iso.linux" + ] provisioner "shell" { execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'" - inline = ["dnf install -y cloud-init cloud-utils-growpart", "systemctl enable cloud-init-local.service", "systemctl enable cloud-init.service", "systemctl enable cloud-config.service", "systemctl enable cloud-final.service"] + inline = ["systemctl enable qemu-guest-agent.service --now"] inline_shebang = "/bin/sh -x" } - provisioner "file" { - destination = "/etc/cloud/cloud.cfg" - source = "${path.cwd}/${var.cloud-init_path}" + provisioner "ansible" { + extra_arguments = concat("${var.ansible_extra_args}","${var.ansible_verbosity}") + playbook_file = "extra/playbooks/provision_rhel.yaml" } provisioner "shell" { execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'" - inline = ["systemctl enable qemu-guest-agent.service --now"] + inline = ["dnf install -y cloud-init cloud-utils-growpart", "systemctl enable cloud-init-local.service", "systemctl enable cloud-init.service", "systemctl enable cloud-config.service", "systemctl enable cloud-final.service"] inline_shebang = "/bin/sh -x" } - provisioner "ansible" { - extra_arguments = concat("${var.ansible_extra_args}","${var.ansible_verbosity}") - playbook_file = "extra/playbooks/provision_rhel.yaml" + provisioner "file" { + destination = "/etc/cloud/cloud.cfg" + source = "${path.cwd}/${var.cloud-init_path}" } } diff --git a/proxmox/proxmox_sles.pkr.hcl b/proxmox/proxmox_sles.pkr.hcl index 2cad0fb..a8af63a 100644 --- a/proxmox/proxmox_sles.pkr.hcl +++ b/proxmox/proxmox_sles.pkr.hcl @@ -68,6 +68,8 @@ variable "disks" { format = string storage_pool = string type = string + io_thread = bool + discard = bool }) default = { cache_mode = "none" @@ -75,6 +77,8 @@ variable "disks" { format = "qcow2" storage_pool = "local" type = "virtio" + io_thread = true + discard = true } } @@ -158,8 +162,40 @@ variable "qemu_agent" { default = true } +variable "efi_storage_pool" { + type = string + default = "local" +} + +variable "pre_enrolled_keys" { + type = bool + default = false +} + +variable "efi_type" { + type = string + default = "4m" +} + +variable "bios" { + type = string + default = "seabios" +} + +variable "use_efi" { + type = bool + default = false +} +variable "machine" { + type = string + default = "pc" +} +variable "tags" { + type = string + default = "bios;template" +} locals { packer_timestamp = formatdate("YYYYMMDD-hhmm", timestamp()) @@ -169,6 +205,7 @@ source "proxmox-iso" "linux" { ballooning_minimum = "${var.ballooning_minimum}" boot_command = ["${var.boot_command}"] boot_wait = "${var.boot_wait}" + bios = "${var.bios}" cores = "${var.cores}" cpu_type = "${var.cpu_type}" disable_kvm = "${var.disable_kvm}" @@ -178,10 +215,13 @@ source "proxmox-iso" "linux" { format = "${var.disks.format}" storage_pool = "${var.disks.storage_pool}" type = "${var.disks.type}" + io_thread = "${var.disks.io_thread}" + discard = "${var.disks.discard}" } http_directory = "${path.cwd}/extra/files" insecure_skip_tls_verify = true iso_file = "${var.iso_file}" + machine = "${var.machine}" memory = "${var.memory}" network_adapters { bridge = "${var.network_adapters.bridge}" @@ -199,16 +239,69 @@ source "proxmox-iso" "linux" { ssh_port = "${var.ssh_port}" ssh_timeout = "10000s" ssh_username = "${var.ssh_username}" + tags = "${var.tags}" task_timeout = "${var.task_timeout}" template_name = "${var.template}.${local.packer_timestamp}" token = "${var.proxmox_token}" unmount_iso = true username = "${var.proxmox_username}" +} +source "proxmox-iso" "linux-efi" { + ballooning_minimum = "${var.ballooning_minimum}" + boot_command = ["${var.boot_command}"] + boot_wait = "${var.boot_wait}" + bios = "${var.bios}" + cores = "${var.cores}" + cpu_type = "${var.cpu_type}" + disable_kvm = "${var.disable_kvm}" + disks { + cache_mode = "${var.disks.cache_mode}" + disk_size = "${var.disks.disk_size}" + format = "${var.disks.format}" + storage_pool = "${var.disks.storage_pool}" + type = "${var.disks.type}" + io_thread = "${var.disks.io_thread}" + discard = "${var.disks.discard}" + } + efi_config { + efi_storage_pool = "${var.efi_storage_pool}" + efi_type = "${var.efi_type}" + pre_enrolled_keys = "${var.pre_enrolled_keys}" + } + http_directory = "${path.cwd}/extra/files" + insecure_skip_tls_verify = true + iso_file = "${var.iso_file}" + machine = "${var.machine}" + memory = "${var.memory}" + network_adapters { + bridge = "${var.network_adapters.bridge}" + model = "${var.network_adapters.model}" + firewall = "${var.network_adapters.firewall}" + mac_address = "${var.network_adapters.mac_address}" + } + node = "${var.proxmox_node}" + os = "${var.os}" + proxmox_url = "${var.proxmox_url}" + qemu_agent = "${var.qemu_agent}" + scsi_controller = "${var.scsi_controller}" + sockets = "${var.sockets}" + ssh_password = "${var.ssh_password}" + ssh_port = "${var.ssh_port}" + ssh_timeout = "10000s" + ssh_username = "${var.ssh_username}" + tags = "${var.tags}" + task_timeout = "${var.task_timeout}" + template_name = "${var.template}.${local.packer_timestamp}" + token = "${var.proxmox_token}" + unmount_iso = true + username = "${var.proxmox_username}" } build { - sources = ["source.proxmox-iso.linux"] + sources = [ + var.use_efi ? "source.proxmox-iso.linux-efi" : "source.proxmox-iso.linux" + ] provisioner "file" { destination = "/etc/cloud/cloud.cfg" diff --git a/proxmox/proxmox_ubuntu.pkr.hcl b/proxmox/proxmox_ubuntu.pkr.hcl index 4f02c62..8cf3e89 100644 --- a/proxmox/proxmox_ubuntu.pkr.hcl +++ b/proxmox/proxmox_ubuntu.pkr.hcl @@ -163,6 +163,41 @@ variable "provision_script_options" { default = "" } +variable "efi_storage_pool" { + type = string + default = "local" +} + +variable "pre_enrolled_keys" { + type = bool + default = false +} + +variable "efi_type" { + type = string + default = "4m" +} + +variable "bios" { + type = string + default = "seabios" +} + +variable "use_efi" { + type = bool + default = false +} + +variable "machine" { + type = string + default = "pc" +} + +variable "tags" { + type = string + default = "bios;template" +} + locals { packer_timestamp = formatdate("YYYYMMDD-hhmm", timestamp()) @@ -172,6 +207,7 @@ source "proxmox-iso" "linux" { ballooning_minimum = "${var.ballooning_minimum}" boot_command = ["${var.boot_command}"] boot_wait = "${var.boot_wait}" + bios = "${var.bios}" cores = "${var.cores}" cpu_type = "${var.cpu_type}" disable_kvm = "${var.disable_kvm}" @@ -185,6 +221,7 @@ source "proxmox-iso" "linux" { http_directory = "${path.cwd}/extra/files" insecure_skip_tls_verify = true iso_file = "${var.iso_file}" + machine = "${var.machine}" memory = "${var.memory}" network_adapters { bridge = "${var.network_adapters.bridge}" @@ -203,6 +240,7 @@ source "proxmox-iso" "linux" { ssh_timeout = "10000s" ssh_username = "${var.ssh_username}" ssh_pty = "true" + tags = "${var.tags}" task_timeout = "${var.task_timeout}" template_name = "${var.template}.${local.packer_timestamp}" token = "${var.proxmox_token}" @@ -211,9 +249,62 @@ source "proxmox-iso" "linux" { } -build { - sources = ["source.proxmox-iso.linux"] +source "proxmox-iso" "linux-efi" { + ballooning_minimum = "${var.ballooning_minimum}" + boot_command = ["${var.boot_command}"] + boot_wait = "${var.boot_wait}" + bios = "${var.bios}" + cores = "${var.cores}" + cpu_type = "${var.cpu_type}" + disable_kvm = "${var.disable_kvm}" + disks { + cache_mode = "${var.disks.cache_mode}" + disk_size = "${var.disks.disk_size}" + format = "${var.disks.format}" + storage_pool = "${var.disks.storage_pool}" + type = "${var.disks.type}" + } + efi_config { + efi_storage_pool = "${var.efi_storage_pool}" + efi_type = "${var.efi_type}" + pre_enrolled_keys = "${var.pre_enrolled_keys}" + } + http_directory = "${path.cwd}/extra/files" + insecure_skip_tls_verify = true + iso_file = "${var.iso_file}" + memory = "${var.memory}" + machine = "${var.machine}" + network_adapters { + bridge = "${var.network_adapters.bridge}" + model = "${var.network_adapters.model}" + firewall = "${var.network_adapters.firewall}" + mac_address = "${var.network_adapters.mac_address}" + } + node = "${var.proxmox_node}" + os = "${var.os}" + proxmox_url = "${var.proxmox_url}" + qemu_agent = "${var.qemu_agent}" + scsi_controller = "${var.scsi_controller}" + sockets = "${var.sockets}" + ssh_password = "${var.ssh_password}" + ssh_port = "${var.ssh_port}" + ssh_timeout = "10000s" + ssh_username = "${var.ssh_username}" + ssh_pty = "true" + tags = "${var.tags}" + task_timeout = "${var.task_timeout}" + template_name = "${var.template}.${local.packer_timestamp}" + token = "${var.proxmox_token}" + unmount_iso = true + username = "${var.proxmox_username}" +} + + +build { + sources = [ + var.use_efi ? "source.proxmox-iso.linux-efi" : "source.proxmox-iso.linux" + ] provisioner "file" { diff --git a/proxmox/proxmox_windows.pkr.hcl b/proxmox/proxmox_windows.pkr.hcl index 501185c..fa7804c 100644 --- a/proxmox/proxmox_windows.pkr.hcl +++ b/proxmox/proxmox_windows.pkr.hcl @@ -208,6 +208,31 @@ variable "virtio_iso_file" { default = "virtio-win.iso" } +variable "use_efi" { + type = bool + default = false +} + +variable "tags" { + type = string + default = "uefi;template" +} + +variable "pre_enrolled_keys" { + type = bool + default = false +} + +variable "efi_type" { + type = string + default = "4m" +} + +variable "efi_storage_pool" { + type = string + default = "local" +} + locals { packer_timestamp = formatdate("YYYYMMDD-hhmm", timestamp()) } @@ -272,6 +297,7 @@ source "proxmox-iso" "windows" { winrm_password = "${var.winrm_password}" winrm_timeout = "8h" winrm_username = "${var.winrm_username}" + tags = "${var.tags}" task_timeout = "${var.task_timeout}" qemu_agent = "${var.qemu_agent}" vga { diff --git a/proxmox/variables_proxmox_almalinux810.pkvars.hcl b/proxmox/variables_almalinux810.pkvars.hcl similarity index 100% rename from proxmox/variables_proxmox_almalinux810.pkvars.hcl rename to proxmox/variables_almalinux810.pkvars.hcl diff --git a/proxmox/variables_almalinux810_uefi.pkvars.hcl b/proxmox/variables_almalinux810_uefi.pkvars.hcl new file mode 100644 index 0000000..06a6738 --- /dev/null +++ b/proxmox/variables_almalinux810_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux/8/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "almalinux8.10.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_almalinux88.pkvars.hcl b/proxmox/variables_almalinux88.pkvars.hcl similarity index 91% rename from proxmox/variables_proxmox_almalinux88.pkvars.hcl rename to proxmox/variables_almalinux88.pkvars.hcl index 85e5792..d2bdc33 100644 --- a/proxmox/variables_proxmox_almalinux88.pkvars.hcl +++ b/proxmox/variables_almalinux88.pkvars.hcl @@ -1,4 +1,4 @@ -ansible_extra_args = ["-e", "@extra/playbooks/provision_alma8_variables.yml", "-e", "@variables/almalinux8.yml","--scp-extra-args", "'-O'"] +ansible_extra_args = ["-e", "@extra/playbooks/provision_alma8_variables.yml", "-e", "@variables/almalinux8.yml","-e", "{\"install_updates\": false}", "--scp-extra-args", "'-O'"] ansible_verbosity = ["-v"] ballooning_minimum = "0" boot_command = " text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux/8/proxmox/ks.cfgesc" diff --git a/proxmox/variables_almalinux88_uefi.pkvars.hcl b/proxmox/variables_almalinux88_uefi.pkvars.hcl new file mode 100644 index 0000000..cc5f852 --- /dev/null +++ b/proxmox/variables_almalinux88_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux/8/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "almalinux8.8.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_almalinux89.pkvars.hcl b/proxmox/variables_almalinux89.pkvars.hcl similarity index 91% rename from proxmox/variables_proxmox_almalinux89.pkvars.hcl rename to proxmox/variables_almalinux89.pkvars.hcl index 80503d8..287b3b7 100644 --- a/proxmox/variables_proxmox_almalinux89.pkvars.hcl +++ b/proxmox/variables_almalinux89.pkvars.hcl @@ -1,4 +1,4 @@ -ansible_extra_args = ["-e", "@extra/playbooks/provision_alma8_variables.yml", "-e", "@variables/almalinux8.yml","--scp-extra-args", "'-O'"] +ansible_extra_args = ["-e", "@extra/playbooks/provision_alma8_variables.yml", "-e", "@variables/almalinux8.yml","-e", "{\"install_updates\": false}", "--scp-extra-args", "'-O'"] ansible_verbosity = ["-v"] ballooning_minimum = "0" boot_command = " text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux/8/proxmox/ks.cfgesc" diff --git a/proxmox/variables_almalinux89_uefi.pkvars.hcl b/proxmox/variables_almalinux89_uefi.pkvars.hcl new file mode 100644 index 0000000..6accbca --- /dev/null +++ b/proxmox/variables_almalinux89_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux/8/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "almalinux8.9.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_almalinux92.pkvars.hcl b/proxmox/variables_almalinux92.pkvars.hcl similarity index 91% rename from proxmox/variables_proxmox_almalinux92.pkvars.hcl rename to proxmox/variables_almalinux92.pkvars.hcl index cf89b97..9ee733b 100644 --- a/proxmox/variables_proxmox_almalinux92.pkvars.hcl +++ b/proxmox/variables_almalinux92.pkvars.hcl @@ -1,5 +1,5 @@ -ansible_extra_args = ["-e", "@extra/playbooks/provision_alma9_variables.yml", "-e", "@variables/almalinux9.yml","--scp-extra-args", "'-O'"] +ansible_extra_args = ["-e", "@extra/playbooks/provision_alma9_variables.yml", "-e", "@variables/almalinux9.yml", "-e", "{\"install_updates\": false}", "--scp-extra-args", "'-O'"] ansible_verbosity = ["-v"] ballooning_minimum = "0" boot_command = " text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux/9/proxmox/ks.cfgesc" diff --git a/proxmox/variables_almalinux92_uefi.pkvars.hcl b/proxmox/variables_almalinux92_uefi.pkvars.hcl new file mode 100644 index 0000000..15b8e0a --- /dev/null +++ b/proxmox/variables_almalinux92_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux/9/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "almalinux9.2.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_almalinux93.pkvars.hcl b/proxmox/variables_almalinux93.pkvars.hcl similarity index 91% rename from proxmox/variables_proxmox_almalinux93.pkvars.hcl rename to proxmox/variables_almalinux93.pkvars.hcl index 965f91a..27dffea 100644 --- a/proxmox/variables_proxmox_almalinux93.pkvars.hcl +++ b/proxmox/variables_almalinux93.pkvars.hcl @@ -1,5 +1,5 @@ -ansible_extra_args = ["-e", "@extra/playbooks/provision_alma9_variables.yml", "-e", "@variables/almalinux9.yml","--scp-extra-args", "'-O'"] +ansible_extra_args = ["-e", "@extra/playbooks/provision_alma9_variables.yml", "-e", "@variables/almalinux9.yml","-e", "{\"install_updates\": false}","--scp-extra-args", "'-O'"] ansible_verbosity = ["-v"] ballooning_minimum = "0" boot_command = " text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux/9/proxmox/ks.cfgesc" diff --git a/proxmox/variables_almalinux93_uefi.pkvars.hcl b/proxmox/variables_almalinux93_uefi.pkvars.hcl new file mode 100644 index 0000000..b478902 --- /dev/null +++ b/proxmox/variables_almalinux93_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux/9/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "almalinux9.3.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_almalinux94.pkvars.hcl b/proxmox/variables_almalinux94.pkvars.hcl similarity index 100% rename from proxmox/variables_proxmox_almalinux94.pkvars.hcl rename to proxmox/variables_almalinux94.pkvars.hcl diff --git a/proxmox/variables_almalinux94_uefi.pkvars.hcl b/proxmox/variables_almalinux94_uefi.pkvars.hcl new file mode 100644 index 0000000..f547553 --- /dev/null +++ b/proxmox/variables_almalinux94_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux/9/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "almalinux9.4.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_opensuse_leap_15_5.pkvars.hcl b/proxmox/variables_opensuse_leap_15_5.pkvars.hcl similarity index 97% rename from proxmox/variables_proxmox_opensuse_leap_15_5.pkvars.hcl rename to proxmox/variables_opensuse_leap_15_5.pkvars.hcl index 4a97fd1..06cd48f 100644 --- a/proxmox/variables_proxmox_opensuse_leap_15_5.pkvars.hcl +++ b/proxmox/variables_opensuse_leap_15_5.pkvars.hcl @@ -1,7 +1,7 @@ ansible_extra_args = ["-e", "@extra/playbooks/provision_alma8_variables.yml", "-e", "@variables/almalinux8.yml","--scp-extra-args", "'-O'"] ansible_verbosity = ["-v"] ballooning_minimum = "0" -boot_command = " linux textmode=1 autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/opensuse_leap/15/proxmox/autoinst.xml " +boot_command = " linux textmode=1 autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/opensuse_leap/15/proxmox/bios/autoinst.xml " boot_wait = "15s" cloud-init_path = "extra/files/cloud-init/suse/generic/cloud.cfg" cores = "4" diff --git a/proxmox/variables_opensuse_leap_15_5_uefi.pkvars.hcl b/proxmox/variables_opensuse_leap_15_5_uefi.pkvars.hcl new file mode 100644 index 0000000..6d64828 --- /dev/null +++ b/proxmox/variables_opensuse_leap_15_5_uefi.pkvars.hcl @@ -0,0 +1,10 @@ +#boot_command = " linux textmode=1 netsetup=dhcp autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/opensuse_leap/15/proxmox/uefi/autoinst1.xml " +boot_command = " c setparams 'Installation' linuxefi /boot/x86_64/loader/linux autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/opensuse_leap/15/proxmox/uefi/autoinst.xml initrd /boot/x86_64/loader/initrd boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "opensuse-leap-15.5.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_opensuse_leap_15_6.pkvars.hcl b/proxmox/variables_opensuse_leap_15_6.pkvars.hcl new file mode 100644 index 0000000..0f954c9 --- /dev/null +++ b/proxmox/variables_opensuse_leap_15_6.pkvars.hcl @@ -0,0 +1,36 @@ +ansible_extra_args = ["-e", "@extra/playbooks/provision_alma8_variables.yml", "-e", "@variables/almalinux8.yml","--scp-extra-args", "'-O'"] +ansible_verbosity = ["-v"] +ballooning_minimum = "0" +boot_command = " linux textmode=1 autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/opensuse_leap/15/proxmox/bios/autoinst.xml " +boot_wait = "15s" +cloud-init_path = "extra/files/cloud-init/suse/generic/cloud.cfg" +cores = "4" +cpu_type = "host" +disable_kvm = false +disks = { + cache_mode = "none" + disk_size = "50G" + format = "raw" + type = "virtio" + storage_pool = "zfs" + io_thread = true + discard = true +} +insecure_skip_tls_verify = true +iso_file = "images:iso/openSUSE-Leap-15.6-DVD-x86_64-Build709.1-Media.iso" +memory = "4096" +network_adapters = { + bridge = "vmbr0" + model = "virtio" + firewall = false + mac_address = "" +} +proxmox_node = "proxmox6" +qemu_agent = true +scsi_controller = "virtio-scsi-single" +sockets = "1" +ssh_password = "password" +ssh_username = "root" +task_timeout = "20m" +template = "opensuse-leap-15.6" +unmount_iso = true diff --git a/proxmox/variables_opensuse_leap_15_6_uefi.pkvars.hcl b/proxmox/variables_opensuse_leap_15_6_uefi.pkvars.hcl new file mode 100644 index 0000000..8a12d35 --- /dev/null +++ b/proxmox/variables_opensuse_leap_15_6_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'Installation' linuxefi /boot/x86_64/loader/linux autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/opensuse_leap/15/proxmox/uefi/autoinst.xml initrd /boot/x86_64/loader/initrd boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "opensuse-leap-15.6.uefi" +tags = "uefi;template" diff --git a/proxmox/variables_proxmox_oraclelinux810.pkvars.hcl b/proxmox/variables_oraclelinux810.pkvars.hcl similarity index 100% rename from proxmox/variables_proxmox_oraclelinux810.pkvars.hcl rename to proxmox/variables_oraclelinux810.pkvars.hcl diff --git a/proxmox/variables_oraclelinux810_uefi.pkvars.hcl b/proxmox/variables_oraclelinux810_uefi.pkvars.hcl new file mode 100644 index 0000000..ca7ab92 --- /dev/null +++ b/proxmox/variables_oraclelinux810_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/oraclelinux/8/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "oraclelinux8.10.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_oraclelinux88.pkvars.hcl b/proxmox/variables_oraclelinux88.pkvars.hcl similarity index 91% rename from proxmox/variables_proxmox_oraclelinux88.pkvars.hcl rename to proxmox/variables_oraclelinux88.pkvars.hcl index bc20a48..02343e2 100644 --- a/proxmox/variables_proxmox_oraclelinux88.pkvars.hcl +++ b/proxmox/variables_oraclelinux88.pkvars.hcl @@ -1,5 +1,5 @@ -ansible_extra_args = ["-e", "@extra/playbooks/provision_oracle8_variables.yml", "-e", "@variables/oraclelinux8.yml","--scp-extra-args", "'-O'"] +ansible_extra_args = ["-e", "@extra/playbooks/provision_oracle8_variables.yml", "-e", "@variables/oraclelinux8.yml","-e", "{\"install_updates\": false}", "--scp-extra-args", "'-O'"] ansible_verbosity = ["-v"] ballooning_minimum = "0" boot_command = " text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/oraclelinux/8/proxmox/ks.cfgesc" diff --git a/proxmox/variables_oraclelinux88_uefi.pkvars.hcl b/proxmox/variables_oraclelinux88_uefi.pkvars.hcl new file mode 100644 index 0000000..bc1e8bc --- /dev/null +++ b/proxmox/variables_oraclelinux88_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/oraclelinux/8/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "oraclelinux8.8.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_oraclelinux89.pkvars.hcl b/proxmox/variables_oraclelinux89.pkvars.hcl similarity index 91% rename from proxmox/variables_proxmox_oraclelinux89.pkvars.hcl rename to proxmox/variables_oraclelinux89.pkvars.hcl index 561666a..48ee578 100644 --- a/proxmox/variables_proxmox_oraclelinux89.pkvars.hcl +++ b/proxmox/variables_oraclelinux89.pkvars.hcl @@ -1,5 +1,5 @@ -ansible_extra_args = ["-e", "@extra/playbooks/provision_oracle8_variables.yml", "-e", "@variables/oraclelinux8.yml","--scp-extra-args", "'-O'"] +ansible_extra_args = ["-e", "@extra/playbooks/provision_oracle8_variables.yml", "-e", "@variables/oraclelinux8.yml","-e", "{\"install_updates\": false}","--scp-extra-args", "'-O'"] ansible_verbosity = ["-v"] ballooning_minimum = "0" boot_command = " text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/oraclelinux/8/proxmox/ks.cfgesc" diff --git a/proxmox/variables_oraclelinux89_uefi.pkvars.hcl b/proxmox/variables_oraclelinux89_uefi.pkvars.hcl new file mode 100644 index 0000000..e7b77e6 --- /dev/null +++ b/proxmox/variables_oraclelinux89_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/oraclelinux/8/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "oraclelinux8.9.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_oraclelinux92.pkvars.hcl b/proxmox/variables_oraclelinux92.pkvars.hcl similarity index 91% rename from proxmox/variables_proxmox_oraclelinux92.pkvars.hcl rename to proxmox/variables_oraclelinux92.pkvars.hcl index b32c2bd..733cd09 100644 --- a/proxmox/variables_proxmox_oraclelinux92.pkvars.hcl +++ b/proxmox/variables_oraclelinux92.pkvars.hcl @@ -1,4 +1,4 @@ -ansible_extra_args = ["-e", "@extra/playbooks/provision_oracle9_variables.yml", "-e", "@variables/oraclelinux9.yml","--scp-extra-args", "'-O'"] +ansible_extra_args = ["-e", "@extra/playbooks/provision_oracle9_variables.yml", "-e", "@variables/oraclelinux9.yml","-e", "{\"install_updates\": false}","--scp-extra-args", "'-O'"] ansible_verbosity = ["-v"] ballooning_minimum = "0" boot_command = " text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/oraclelinux/9/proxmox/ks.cfgesc" diff --git a/proxmox/variables_oraclelinux92_uefi.pkvars.hcl b/proxmox/variables_oraclelinux92_uefi.pkvars.hcl new file mode 100644 index 0000000..a71f2d2 --- /dev/null +++ b/proxmox/variables_oraclelinux92_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/oraclelinux/9/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "oraclelinux9.2.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_oraclelinux93.pkvars.hcl b/proxmox/variables_oraclelinux93.pkvars.hcl similarity index 91% rename from proxmox/variables_proxmox_oraclelinux93.pkvars.hcl rename to proxmox/variables_oraclelinux93.pkvars.hcl index 50c398f..a6f7e32 100644 --- a/proxmox/variables_proxmox_oraclelinux93.pkvars.hcl +++ b/proxmox/variables_oraclelinux93.pkvars.hcl @@ -1,4 +1,4 @@ -ansible_extra_args = ["-e", "@extra/playbooks/provision_oracle9_variables.yml", "-e", "@variables/oraclelinux9.yml","--scp-extra-args", "'-O'"] +ansible_extra_args = ["-e", "@extra/playbooks/provision_oracle9_variables.yml", "-e", "@variables/oraclelinux9.yml","-e", "{\"install_updates\": false}","--scp-extra-args", "'-O'"] ansible_verbosity = ["-v"] ballooning_minimum = "0" boot_command = " text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/oraclelinux/9/proxmox/ks.cfgesc" diff --git a/proxmox/variables_oraclelinux93_uefi.pkvars.hcl b/proxmox/variables_oraclelinux93_uefi.pkvars.hcl new file mode 100644 index 0000000..108ec0d --- /dev/null +++ b/proxmox/variables_oraclelinux93_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/oraclelinux/9/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "oraclelinux9.3.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_oraclelinux94.pkvars.hcl b/proxmox/variables_oraclelinux94.pkvars.hcl similarity index 100% rename from proxmox/variables_proxmox_oraclelinux94.pkvars.hcl rename to proxmox/variables_oraclelinux94.pkvars.hcl diff --git a/proxmox/variables_oraclelinux94_uefi.pkvars.hcl b/proxmox/variables_oraclelinux94_uefi.pkvars.hcl new file mode 100644 index 0000000..a59d00e --- /dev/null +++ b/proxmox/variables_oraclelinux94_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/oraclelinux/9/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "oraclelinux9.4.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_rockylinux810.pkvars.hcl b/proxmox/variables_rockylinux810.pkvars.hcl similarity index 99% rename from proxmox/variables_proxmox_rockylinux810.pkvars.hcl rename to proxmox/variables_rockylinux810.pkvars.hcl index 1393336..f0e5611 100644 --- a/proxmox/variables_proxmox_rockylinux810.pkvars.hcl +++ b/proxmox/variables_rockylinux810.pkvars.hcl @@ -35,5 +35,3 @@ ssh_username = "root" task_timeout = "20m" template = "rockylinux8.10" unmount_iso = true - - diff --git a/proxmox/variables_rockylinux810_uefi.pkvars.hcl b/proxmox/variables_rockylinux810_uefi.pkvars.hcl new file mode 100644 index 0000000..b3ef3c2 --- /dev/null +++ b/proxmox/variables_rockylinux810_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rockylinux/8/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "rockylinux8.10.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_rockylinux88.pkvars.hcl b/proxmox/variables_rockylinux88.pkvars.hcl similarity index 91% rename from proxmox/variables_proxmox_rockylinux88.pkvars.hcl rename to proxmox/variables_rockylinux88.pkvars.hcl index 33c423b..21590fa 100644 --- a/proxmox/variables_proxmox_rockylinux88.pkvars.hcl +++ b/proxmox/variables_rockylinux88.pkvars.hcl @@ -1,5 +1,5 @@ -ansible_extra_args = ["-e", "@extra/playbooks/provision_rocky8_variables.yml", "-e", "@variables/rockylinux8.yml","--scp-extra-args", "'-O'"] +ansible_extra_args = ["-e", "@extra/playbooks/provision_rocky8_variables.yml", "-e", "@variables/rockylinux8.yml", "-e", "{\"install_updates\": false}", "--scp-extra-args", "'-O'"] ansible_verbosity = ["-v"] ballooning_minimum = "0" boot_command = " text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rockylinux/8/proxmox/ks.cfgesc" @@ -35,4 +35,3 @@ ssh_username = "root" task_timeout = "20m" template = "rockylinux8.8" unmount_iso = true - diff --git a/proxmox/variables_rockylinux88_uefi.pkvars.hcl b/proxmox/variables_rockylinux88_uefi.pkvars.hcl new file mode 100644 index 0000000..2bda03b --- /dev/null +++ b/proxmox/variables_rockylinux88_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rockylinux/8/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "rockylinux8.8.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_rockylinux89.pkvars.hcl b/proxmox/variables_rockylinux89.pkvars.hcl similarity index 91% rename from proxmox/variables_proxmox_rockylinux89.pkvars.hcl rename to proxmox/variables_rockylinux89.pkvars.hcl index 161ae6e..15d1f13 100644 --- a/proxmox/variables_proxmox_rockylinux89.pkvars.hcl +++ b/proxmox/variables_rockylinux89.pkvars.hcl @@ -1,5 +1,5 @@ -ansible_extra_args = ["-e", "@extra/playbooks/provision_rocky8_variables.yml", "-e", "@variables/rockylinux8.yml","--scp-extra-args", "'-O'"] +ansible_extra_args = ["-e", "@extra/playbooks/provision_rocky8_variables.yml", "-e", "@variables/rockylinux8.yml", "-e", "{\"install_updates\": false}", "--scp-extra-args", "'-O'"] ansible_verbosity = ["-v"] ballooning_minimum = "0" boot_command = " text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rockylinux/8/proxmox/ks.cfgesc" diff --git a/proxmox/variables_rockylinux89_uefi.pkvars.hcl b/proxmox/variables_rockylinux89_uefi.pkvars.hcl new file mode 100644 index 0000000..333baf3 --- /dev/null +++ b/proxmox/variables_rockylinux89_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rockylinux/8/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "rockylinux8.9.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_rockylinux92.pkvars.hcl b/proxmox/variables_rockylinux92.pkvars.hcl similarity index 91% rename from proxmox/variables_proxmox_rockylinux92.pkvars.hcl rename to proxmox/variables_rockylinux92.pkvars.hcl index 6f00ecf..80328bb 100644 --- a/proxmox/variables_proxmox_rockylinux92.pkvars.hcl +++ b/proxmox/variables_rockylinux92.pkvars.hcl @@ -1,5 +1,5 @@ -ansible_extra_args = ["-e", "@extra/playbooks/provision_rocky9_variables.yml", "-e", "@variables/rockylinux9.yml","--scp-extra-args", "'-O'"] +ansible_extra_args = ["-e", "@extra/playbooks/provision_rocky9_variables.yml", "-e", "@variables/rockylinux9.yml", "-e", "{\"install_updates\": false}", "--scp-extra-args", "'-O'"] ansible_verbosity = ["-v"] ballooning_minimum = "0" boot_command = " text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rockylinux/9/proxmox/ks.cfgesc" diff --git a/proxmox/variables_rockylinux92_uefi.pkvars.hcl b/proxmox/variables_rockylinux92_uefi.pkvars.hcl new file mode 100644 index 0000000..af2c630 --- /dev/null +++ b/proxmox/variables_rockylinux92_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rockylinux/9/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "rockylinux9.2.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_rockylinux93.pkvars.hcl b/proxmox/variables_rockylinux93.pkvars.hcl similarity index 91% rename from proxmox/variables_proxmox_rockylinux93.pkvars.hcl rename to proxmox/variables_rockylinux93.pkvars.hcl index 6b35692..0020540 100644 --- a/proxmox/variables_proxmox_rockylinux93.pkvars.hcl +++ b/proxmox/variables_rockylinux93.pkvars.hcl @@ -1,5 +1,5 @@ -ansible_extra_args = ["-e", "@extra/playbooks/provision_rocky9_variables.yml", "-e", "@variables/rockylinux9.yml","--scp-extra-args", "'-O'"] +ansible_extra_args = ["-e", "@extra/playbooks/provision_rocky9_variables.yml", "-e", "@variables/rockylinux9.yml", "-e", "{\"install_updates\": false}", "--scp-extra-args", "'-O'"] ansible_verbosity = ["-v"] ballooning_minimum = "0" boot_command = " text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rockylinux/9/proxmox/ks.cfgesc" diff --git a/proxmox/variables_rockylinux93_uefi.pkvars.hcl b/proxmox/variables_rockylinux93_uefi.pkvars.hcl new file mode 100644 index 0000000..491dd7f --- /dev/null +++ b/proxmox/variables_rockylinux93_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rockylinux/9/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "rockylinux9.3.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_rockylinux94.pkvars.hcl b/proxmox/variables_rockylinux94.pkvars.hcl similarity index 100% rename from proxmox/variables_proxmox_rockylinux94.pkvars.hcl rename to proxmox/variables_rockylinux94.pkvars.hcl diff --git a/proxmox/variables_rockylinux94_uefi.pkvars.hcl b/proxmox/variables_rockylinux94_uefi.pkvars.hcl new file mode 100644 index 0000000..7cfbf75 --- /dev/null +++ b/proxmox/variables_rockylinux94_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = " c setparams 'kickstart' linuxefi /images/pxeboot/vmlinuz inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rockylinux/9/proxmox/ks.cfg initrdefi /images/pxeboot/initrd.img boot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "rockylinux9.4.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_ubuntu2204.pkvars.hcl b/proxmox/variables_ubuntu2204.pkvars.hcl similarity index 100% rename from proxmox/variables_proxmox_ubuntu2204.pkvars.hcl rename to proxmox/variables_ubuntu2204.pkvars.hcl diff --git a/proxmox/variables_ubuntu2204_uefi.pkvars.hcl b/proxmox/variables_ubuntu2204_uefi.pkvars.hcl new file mode 100644 index 0000000..8ec4de1 --- /dev/null +++ b/proxmox/variables_ubuntu2204_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = "clinux /casper/vmlinuz quiet autoinstall net.ifnames=0 biosdevname=0 ip=dhcp ipv6.disable=1 ds='nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu/22.04/proxmox/' initrd /casper/initrdboot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "ubuntu22.04.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_ubuntu2304.pkvars.hcl b/proxmox/variables_ubuntu2304.pkvars.hcl similarity index 100% rename from proxmox/variables_proxmox_ubuntu2304.pkvars.hcl rename to proxmox/variables_ubuntu2304.pkvars.hcl diff --git a/proxmox/variables_ubuntu2304_uefi.pkvars.hcl b/proxmox/variables_ubuntu2304_uefi.pkvars.hcl new file mode 100644 index 0000000..db65b25 --- /dev/null +++ b/proxmox/variables_ubuntu2304_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = "clinux /casper/vmlinuz quiet autoinstall net.ifnames=0 biosdevname=0 ip=dhcp ipv6.disable=1 ds='nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu/24.04/proxmox/' initrd /casper/initrdboot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "ubuntu24.04.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_ubuntu2404.pkvars.hcl b/proxmox/variables_ubuntu2404.pkvars.hcl similarity index 100% rename from proxmox/variables_proxmox_ubuntu2404.pkvars.hcl rename to proxmox/variables_ubuntu2404.pkvars.hcl diff --git a/proxmox/variables_ubuntu2404_uefi.pkvars.hcl b/proxmox/variables_ubuntu2404_uefi.pkvars.hcl new file mode 100644 index 0000000..57aa837 --- /dev/null +++ b/proxmox/variables_ubuntu2404_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = "clinux /casper/vmlinuz quiet autoinstall net.ifnames=0 biosdevname=0 ip=dhcp ipv6.disable=1 ds='nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu/24.04/proxmox-uefi/' initrd /casper/initrdboot" +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "ubuntu24.04.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_windows2019-dc.pkvars.hcl b/proxmox/variables_windows2019-dc.pkvars.hcl similarity index 100% rename from proxmox/variables_proxmox_windows2019-dc.pkvars.hcl rename to proxmox/variables_windows2019-dc.pkvars.hcl diff --git a/proxmox/variables_windows2019-dc_uefi.pkvars.hcl b/proxmox/variables_windows2019-dc_uefi.pkvars.hcl new file mode 100644 index 0000000..3f9954e --- /dev/null +++ b/proxmox/variables_windows2019-dc_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = [""] +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "windows2019-dc.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_windows2019-std.pkvars.hcl b/proxmox/variables_windows2019-std.pkvars.hcl similarity index 100% rename from proxmox/variables_proxmox_windows2019-std.pkvars.hcl rename to proxmox/variables_windows2019-std.pkvars.hcl diff --git a/proxmox/variables_windows2019-std_uefi.pkvars.hcl b/proxmox/variables_windows2019-std_uefi.pkvars.hcl new file mode 100644 index 0000000..8a0d604 --- /dev/null +++ b/proxmox/variables_windows2019-std_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = [""] +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "windows2019-std.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_windows2022-dc.pkvars.hcl b/proxmox/variables_windows2022-dc.pkvars.hcl similarity index 96% rename from proxmox/variables_proxmox_windows2022-dc.pkvars.hcl rename to proxmox/variables_windows2022-dc.pkvars.hcl index d11d1f6..0118a64 100644 --- a/proxmox/variables_proxmox_windows2022-dc.pkvars.hcl +++ b/proxmox/variables_windows2022-dc.pkvars.hcl @@ -38,7 +38,7 @@ scsi_controller = "virtio-scsi-single" sockets = "1" sysprep_unattended = "./extra/files/windows/2022/proxmox/unattend.xml" task_timeout = "20m" -template = "windows2022-dc.microsoft.com" +template = "windows2022-dc" unmount_iso = true winrm_password = "password" winrm_username = "Administrator" diff --git a/proxmox/variables_windows2022-dc_uefi.pkvars.hcl b/proxmox/variables_windows2022-dc_uefi.pkvars.hcl new file mode 100644 index 0000000..97475fb --- /dev/null +++ b/proxmox/variables_windows2022-dc_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = [""] +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "windows2022-dc.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox/variables_proxmox_windows2022-std.pkvars.hcl b/proxmox/variables_windows2022-std.pkvars.hcl similarity index 100% rename from proxmox/variables_proxmox_windows2022-std.pkvars.hcl rename to proxmox/variables_windows2022-std.pkvars.hcl diff --git a/proxmox/variables_windows2022-std_uefi.pkvars.hcl b/proxmox/variables_windows2022-std_uefi.pkvars.hcl new file mode 100644 index 0000000..387b363 --- /dev/null +++ b/proxmox/variables_windows2022-std_uefi.pkvars.hcl @@ -0,0 +1,9 @@ +boot_command = [""] +efi_storage_pool = "zfs" +efi_type = "4m" +pre_enrolled_keys = "true" +bios = "ovmf" +machine = "q35" +use_efi = "true" +template = "windows2022-std.uefi" +tags = "uefi;template" \ No newline at end of file diff --git a/proxmox_almalinux_810.sh b/proxmox_almalinux_810.sh deleted file mode 100755 index 8ead232..0000000 --- a/proxmox_almalinux_810.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash - -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="almalinux810" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." \ No newline at end of file diff --git a/proxmox_almalinux_88.sh b/proxmox_almalinux_88.sh deleted file mode 100755 index 9e62512..0000000 --- a/proxmox_almalinux_88.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash - -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="almalinux88" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." \ No newline at end of file diff --git a/proxmox_almalinux_89.sh b/proxmox_almalinux_89.sh deleted file mode 100755 index 3adf16e..0000000 --- a/proxmox_almalinux_89.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash - -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="almalinux89" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." \ No newline at end of file diff --git a/proxmox_almalinux_92.sh b/proxmox_almalinux_92.sh deleted file mode 100755 index f814207..0000000 --- a/proxmox_almalinux_92.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="almalinux92" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_almalinux_93.sh b/proxmox_almalinux_93.sh deleted file mode 100755 index c24224e..0000000 --- a/proxmox_almalinux_93.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="almalinux93" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_almalinux_94.sh b/proxmox_almalinux_94.sh deleted file mode 100755 index 46b424a..0000000 --- a/proxmox_almalinux_94.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="almalinux94" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_generic.sh b/proxmox_generic.sh new file mode 100755 index 0000000..c3ffcc6 --- /dev/null +++ b/proxmox_generic.sh @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +# Define colors +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# Default values +default_secrets_file="secrets/proxmox.sh" +default_version="rockylinux810" +default_family="rhel" +default_uefi="false" + +# Start time +start_time=$(date +%s%N) + +# Verbosity control +verbose=0 +PACKER_LOG=0 + +log() { + if [ "$verbose" -eq 1 ]; then + echo -e "${YELLOW}[INFO]${NC} $1" + fi +} + +error() { + echo -e "${RED}[ERROR]${NC} $1" >&2 +} + +success() { + echo -e "${GREEN}[SUCCESS]${NC} $1" +} + +# Function to display usage +usage() { + echo "Usage: $0 [-v] [-s ] [-V ] [-F ] [-U ]" + echo " -v Enable verbose mode" + echo " -s Path to the secrets file (default: secrets/proxmox.sh)" + echo " -V Version string (default: rockylinux810)" + echo " -F Family string (default: rhel)" + echo " -U UEFI support (default: false)" + exit 1 +} + +# Parse command-line arguments +while getopts ":vs:V:F:U:" opt; do + case ${opt} in + v ) + verbose=1 + PACKER_LOG=1 + ;; + s ) + secrets_file=$OPTARG + ;; + V ) + version=$OPTARG + ;; + F ) + family=$OPTARG + ;; + U ) + uefi=$OPTARG + ;; + \? ) + usage + ;; + esac +done + +# Use defaults if parameters are not provided +secrets_file=${secrets_file:-$default_secrets_file} +version=${version:-$default_version} +family=${family:-$default_family} +uefi=${uefi:-$default_uefi} + +# Validate UEFI parameter +if [ "$uefi" != "true" ] && [ "$uefi" != "false" ]; then + error "Invalid value for UEFI. Use 'true' or 'false'." + exit 1 +fi + +# Load secrets file +if [ -e "$secrets_file" ]; then + # shellcheck source=/dev/null + source "$secrets_file" + log "Secrets file '$secrets_file' sourced successfully." +else + error "Secrets file '$secrets_file' not found." + exit 1 +fi + +var_file="proxmox/variables_${version}.pkvars.hcl" +uefi_var_file="proxmox/variables_${version}_uefi.pkvars.hcl" +template="proxmox/proxmox_${family}.pkr.hcl" + +# Display variable values +echo -e "${BLUE}--- Variable Values ---${NC}" +echo -e "PACKER_LOG: ${YELLOW}$PACKER_LOG${NC}" +echo -e "Secrets File: ${YELLOW}$secrets_file${NC}" +echo -e "Version: ${YELLOW}$version${NC}" +echo -e "Family: ${YELLOW}$family${NC}" +echo -e "UEFI: ${YELLOW}$uefi${NC}" +echo -e "Var File: ${YELLOW}$var_file${NC}" +echo -e "UEFI Var File: ${YELLOW}$uefi_var_file${NC}" +echo -e "Template: ${YELLOW}$template${NC}" +echo -e "${BLUE}-----------------------${NC}" + +# Start message +echo -e "${YELLOW}Starting the Packer script...${NC}" + +# Validate with Packer +if [ "$uefi" == "true" ]; then + if [ -e "$uefi_var_file" ]; then + echo -e "${YELLOW}UEFI variables file '$uefi_var_file' found. Validating with Packer...${NC}" + packer validate --var-file="$var_file" --var-file="$uefi_var_file" "$template" + rc=$? + else + echo -e "${RED}UEFI is enabled but the UEFI variables file '$uefi_var_file' not found. Exiting now.${NC}" + exit 1 + fi +else + echo -e "${YELLOW}UEFI not enabled. Validating with Packer...${NC}" + packer validate --var-file="$var_file" "$template" + rc=$? +fi + +if [ $rc -ne 0 ]; then + echo -e "${RED}Packer validate failed - exiting now.${NC}" + exit $rc +else + echo -e "${GREEN}Packer template validation successful!${NC}" + if [ "$uefi" == "true" ] && [ -e "$uefi_var_file" ]; then + echo -e "${YELLOW}UEFI variables file found. Building with Packer...${NC}" + packer build --force --var-file="$var_file" --var-file="$uefi_var_file" "$template" + else + echo -e "${YELLOW}No UEFI variables file found or UEFI not enabled. Building with Packer...${NC}" + packer build --force --var-file="$var_file" "$template" + fi + rc=$? + echo $rc +fi + +if [ $rc -ne 0 ]; then + echo -e "${RED}Packer build failed - exiting now.${NC}" + exit $rc +else + echo -e "${GREEN}Packer build completed successfully!${NC}" +fi + +# End time +end_time=$(date +%s%N) + +# Calculate time difference in seconds +time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) + +# Convert time difference to hours, minutes, and seconds +hours=$(( time_diff_seconds / 3600 )) +minutes=$(( (time_diff_seconds % 3600) / 60 )) +seconds=$(( time_diff_seconds % 60 )) + +echo -e "${GREEN}Packer build took: $hours hours, $minutes minutes, and $seconds seconds.${NC}" diff --git a/proxmox_opensuse_leap_15_5.sh b/proxmox_opensuse_leap_15_5.sh deleted file mode 100755 index 6895e15..0000000 --- a/proxmox_opensuse_leap_15_5.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="opensuse_leap_15_5" -family="sles" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." - diff --git a/proxmox_oraclelinux_810.sh b/proxmox_oraclelinux_810.sh deleted file mode 100755 index 03a0ebb..0000000 --- a/proxmox_oraclelinux_810.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="oraclelinux810" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_oraclelinux_88.sh b/proxmox_oraclelinux_88.sh deleted file mode 100755 index e0527c9..0000000 --- a/proxmox_oraclelinux_88.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="oraclelinux88" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_oraclelinux_89.sh b/proxmox_oraclelinux_89.sh deleted file mode 100755 index 2eda010..0000000 --- a/proxmox_oraclelinux_89.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="oraclelinux89" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_oraclelinux_92.sh b/proxmox_oraclelinux_92.sh deleted file mode 100755 index b4de825..0000000 --- a/proxmox_oraclelinux_92.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="oraclelinux92" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_oraclelinux_93.sh b/proxmox_oraclelinux_93.sh deleted file mode 100755 index ff64177..0000000 --- a/proxmox_oraclelinux_93.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="oraclelinux93" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_oraclelinux_94.sh b/proxmox_oraclelinux_94.sh deleted file mode 100755 index e16ff0b..0000000 --- a/proxmox_oraclelinux_94.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="oraclelinux94" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_rockylinux_810.sh b/proxmox_rockylinux_810.sh deleted file mode 100755 index e03ad51..0000000 --- a/proxmox_rockylinux_810.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="rockylinux810" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_rockylinux_88.sh b/proxmox_rockylinux_88.sh deleted file mode 100755 index 0d494dd..0000000 --- a/proxmox_rockylinux_88.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="rockylinux88" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_rockylinux_89.sh b/proxmox_rockylinux_89.sh deleted file mode 100755 index 1233320..0000000 --- a/proxmox_rockylinux_89.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="rockylinux89" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_rockylinux_92.sh b/proxmox_rockylinux_92.sh deleted file mode 100755 index 83c6aea..0000000 --- a/proxmox_rockylinux_92.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash - -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - - -version="rockylinux92" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_rockylinux_93.blank.sh b/proxmox_rockylinux_93.blank.sh deleted file mode 100755 index 8c5f258..0000000 --- a/proxmox_rockylinux_93.blank.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash - -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - - -version="rockylinux93" -family="rhel_blank" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_rockylinux_93.sh b/proxmox_rockylinux_93.sh deleted file mode 100755 index 4dffe0c..0000000 --- a/proxmox_rockylinux_93.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash - -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - - -version="rockylinux93" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_rockylinux_94.sh b/proxmox_rockylinux_94.sh deleted file mode 100755 index cadceab..0000000 --- a/proxmox_rockylinux_94.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash - -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - - -version="rockylinux94" -family="rhel" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_ubuntu_2204.sh b/proxmox_ubuntu_2204.sh deleted file mode 100755 index 288d582..0000000 --- a/proxmox_ubuntu_2204.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash - -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="ubuntu2204" -family="ubuntu" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." \ No newline at end of file diff --git a/proxmox_ubuntu_2204_hwe.sh b/proxmox_ubuntu_2204_hwe.sh deleted file mode 100755 index 6f00570..0000000 --- a/proxmox_ubuntu_2204_hwe.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash - -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="ubuntu2204" -family="ubuntu" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" -var="boot_command=clinux /casper/hwe-vmlinuz quiet autoinstall net.ifnames=0 biosdevname=0 ip=dhcp ipv6.disable=1 ds=\"nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu/22.04/proxmox/\"initrd /casper/hwe-initrdboot" -var "template=ubuntu22.04.hwe" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" -var="boot_command=clinux /casper/hwe-vmlinuz quiet autoinstall net.ifnames=0 biosdevname=0 ip=dhcp ipv6.disable=1 ds=\"nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu/22.04/proxmox/\"initrd /casper/hwe-initrdboot" -var "template=ubuntu22.04.hwe" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." \ No newline at end of file diff --git a/proxmox_ubuntu_2304.sh b/proxmox_ubuntu_2304.sh deleted file mode 100755 index 695e9a8..0000000 --- a/proxmox_ubuntu_2304.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash - -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="ubuntu2304" -family="ubuntu" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." \ No newline at end of file diff --git a/proxmox_ubuntu_2404.sh b/proxmox_ubuntu_2404.sh deleted file mode 100755 index 9817129..0000000 --- a/proxmox_ubuntu_2404.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash - -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -version="ubuntu2404" -family="ubuntu" -var_file="proxmox/variables_proxmox_${version}.pkvars.hcl" -template="proxmox/proxmox_${family}.pkr.hcl" - -packer validate --var-file="$var_file" "$template" -rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - packer build --force --var-file="$var_file" "$template" - rc=$? - fi - -if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." \ No newline at end of file diff --git a/proxmox_windows_2019-dc.sh b/proxmox_windows_2019-dc.sh deleted file mode 100755 index ccf85b8..0000000 --- a/proxmox_windows_2019-dc.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env bash - -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -template1="./proxmox/proxmox_windows.pkr.hcl" -var_file="./proxmox/variables_proxmox_windows2019-dc.pkvars.hcl" -packer="packer" - -if [ -z "$1" ]; then - set -- 0 -fi - -if [ "$1" -eq 1 ]; then - # 1 pass - $packer --version - $packer validate --var-file="$var_file" "$template1" - rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - $packer build --force --var-file="$var_file" "$template1" - rc=$? - fi - - if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc - else - echo "Packer build for $template1 success" - fi -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_windows_2019-std.sh b/proxmox_windows_2019-std.sh deleted file mode 100755 index dc59c45..0000000 --- a/proxmox_windows_2019-std.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env bash - -# Start time -start_time=$(date +%s) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -template1="./proxmox/proxmox_windows.pkr.hcl" -var_file="./proxmox/variables_proxmox_windows2019-std.pkvars.hcl" -packer="packer" - - -if [ -z "$1" ] || [ "$1" -eq 1 ]; then - # 1 pass - $packer --version - $packer validate --var-file="$var_file" "$template1" - - rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - $packer build --force --var-file="$var_file" "$template1" - rc=$? - fi - - if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc - else - echo "Packer build for $template1 success" - fi -fi - -# End time -end_time=$(date +%s) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." diff --git a/proxmox_windows_2022-dc.sh b/proxmox_windows_2022-dc.sh deleted file mode 100755 index b861e6d..0000000 --- a/proxmox_windows_2022-dc.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env bash - -# Start time -start_time=$(date +%s%N) - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -export PACKER_LOG=0 - - -template1="./proxmox/proxmox_windows.pkr.hcl" -var_file="./proxmox/variables_proxmox_windows2022-dc.pkvars.hcl" -packer="packer" - - -if [ -z "$1" ] || [ "$1" -eq 1 ]; then - # 1 pass - $packer --version - $packer validate --var-file="$var_file" "$template1" - - rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - $packer build --force --var-file="$var_file" "$template1" - rc=$? - fi - - if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc - else - echo "Packer build for $template1 success" - fi -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds." - diff --git a/proxmox_windows_2022-std.sh b/proxmox_windows_2022-std.sh deleted file mode 100755 index 480c334..0000000 --- a/proxmox_windows_2022-std.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env bash - -# Start time -start_time=$(date +%s%N) - -export PACKER_LOG=0 - -if [ -e secrets/proxmox.sh ]; then - # shellcheck source=secrets/proxmox.sh - source secrets/proxmox.sh -else - echo "secrets/proxmox.sh not found" -fi - -template1="./proxmox/proxmox_windows.pkr.hcl" -var_file="./proxmox/variables_proxmox_windows2022-std.pkvars.hcl" -packer="packer" - - -if [ -z "$1" ] || [ "$1" -eq 1 ]; then - # 1 pass - $packer --version - $packer validate --var-file="$var_file" "$template1" - - rc=$? - if [ $rc -ne 0 ]; then - echo "Packer validate failed - exiting now" - exit $rc - else - $packer build --force --var-file="$var_file" "$template1" - rc=$? - fi - - if [ $rc -ne 0 ]; then - echo "Packer build failed - exiting now" - exit $rc - else - echo "Packer build for $template1 success" - fi -fi - -# End time -end_time=$(date +%s%N) - -# Calculate time difference in seconds -time_diff_seconds=$(( (end_time - start_time) / 1000000000 )) - - -# Convert time difference to hours, minutes, and seconds -hours=$(( time_diff_seconds / 3600 )) -minutes=$(( (time_diff_seconds % 3600) / 60 )) -seconds=$(( time_diff_seconds % 60 )) - -echo "Packer build took: $hours hours, $minutes minutes, and $seconds seconds."