Skip to content

Commit

Permalink
feat: add debian 12
Browse files Browse the repository at this point in the history
- Adds Debian 12 (Bookworm) to the project.
- Minor update to Debian 11 files.

Signed-off-by: Ryan Johnson <[email protected]>
  • Loading branch information
Ryan Johnson committed Jun 15, 2023
1 parent dc39723 commit cd74584
Show file tree
Hide file tree
Showing 12 changed files with 935 additions and 49 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:boom: **Enhancement**:

- Adds VMware Photon OS 5.0 to the project. [GH-582](https://github.com/vmware-samples/packer-examples-for-vsphere/pull/582)
- Adds Debian 12 to the project. [GH-584](https://github.com/vmware-samples/packer-examples-for-vsphere/pull/584)

:sweat_drops: **Chore**:

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The following builds are available:

- VMware Photon OS 5
- VMware Photon OS 4
- Debian 12
- Debian 11
- Ubuntu Server 22.04 LTS (cloud-init)
- Ubuntu Server 20.04 LTS (cloud-init)
Expand Down Expand Up @@ -812,6 +813,8 @@ The project supports using a datastore to store your guest operating system [`.i
- [Download][download-linux-photon-5] the latest release of the **FULL** `.iso` image. (_e.g.,_ `photon-5.0-xxxxxxxxx.x86_64.iso`)
- VMware Photon OS 4
- [Download][download-linux-photon-4] the latest release of the **FULL** `.iso` image. (_e.g.,_ `photon-4.0-xxxxxxxxx.iso`)
- Debian 12
- [Download][download-linux-debian-12] the latest **netinst** release `.iso` image. (_e.g.,_ `debian-12.x.x-amd64-netinst.iso`)
- Debian 11
- [Download][download-linux-debian-11] the latest **netinst** release `.iso` image. (_e.g.,_ `debian-11.x.x-amd64-netinst.iso`)
- Ubuntu Server 22.04 LTS
Expand Down Expand Up @@ -1015,7 +1018,8 @@ Happy building!!!
[download-linux-centos-7]: http://isoredirect.centos.org/centos/7/isos/x86_64/
[download-linux-centos-stream-8]: http://isoredirect.centos.org/centos/8-stream/isos/x86_64/
[download-linux-centos-stream-9]: http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/iso/
[download-linux-debian-11]: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/
[download-linux-debian-12]: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/
[download-linux-debian-11]: https://cdimage.debian.org/cdimage/archive/11.7.0/amd64/iso-cd/
[download-linux-photon-5]: https://packages.vmware.com/photon/5.0/GA/iso/
[download-linux-photon-4]: https://packages.vmware.com/photon/4.0/Rev2/iso/
[download-linux-rhel-7]: https://access.redhat.com/downloads/content/69/ver=/rhel---7/7.9/x86_64/product-software
Expand Down
119 changes: 76 additions & 43 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,37 @@ menu_option_2() {
}

menu_option_3() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/debian/12/
echo -e "\nCONFIRM: Build a Debian 12 Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi

### Build a Debian 12 Template for VMware vSphere. ###
echo "Building a Debian 12 Template for VMware vSphere..."

### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"

### Start the Build. ###
echo "Starting the build...."
packer build -force \
-var-file="$CONFIG_PATH/vsphere.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxy.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
"$INPUT_PATH"

### All done. ###
echo "Done."
}

menu_option_4() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/debian/11/
echo -e "\nCONFIRM: Build a Debian 11 Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -112,7 +143,7 @@ menu_option_3() {
echo "Done."
}

menu_option_4() {
menu_option_5() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/ubuntu/22-04-lts/
echo -e "\nCONFIRM: Build a Ubuntu Server 22.04 LTS (cloud-init) Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -143,7 +174,7 @@ menu_option_4() {
echo "Done."
}

menu_option_5() {
menu_option_6() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/ubuntu/20-04-lts/
echo -e "\nCONFIRM: Build a Ubuntu Server 20.04 LTS (cloud-init) Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -174,7 +205,7 @@ menu_option_5() {
echo "Done."
}

menu_option_6() {
menu_option_7() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/rhel/9/
echo -e "\nCONFIRM: Build a Red Hat Enterprise Linux 9 Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -206,7 +237,7 @@ menu_option_6() {
echo "Done."
}

menu_option_7() {
menu_option_8() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/rhel/8/
echo -e "\nCONFIRM: Build a Red Hat Enterprise Linux 8 Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -238,7 +269,7 @@ menu_option_7() {
echo "Done."
}

menu_option_8() {
menu_option_9() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/rhel/7/
echo -e "\nCONFIRM: Build a Red Hat Enterprise Linux 7 Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -270,7 +301,7 @@ menu_option_8() {
echo "Done."
}

menu_option_9() {
menu_option_10() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/almalinux/9/
echo -e "\nCONFIRM: Build a AlmaLinux OS 9 Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -301,7 +332,7 @@ menu_option_9() {
echo "Done."
}

menu_option_10() {
menu_option_11() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/almalinux/8/
echo -e "\nCONFIRM: Build a AlmaLinux OS 8 Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -332,7 +363,7 @@ menu_option_10() {
echo "Done."
}

menu_option_11() {
menu_option_12() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/rocky/9/
echo -e "\nCONFIRM: Build a Rocky Linux 9 Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -363,7 +394,7 @@ menu_option_11() {
echo "Done."
}

menu_option_12() {
menu_option_13() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/rocky/8/
echo -e "\nCONFIRM: Build a Rocky Linux 8 Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -394,7 +425,7 @@ menu_option_12() {
echo "Done."
}

menu_option_13() {
menu_option_14() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/centos/9-stream/
echo -e "\nCONFIRM: Build a CentOS Stream 9 Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -425,7 +456,7 @@ menu_option_13() {
echo "Done."
}

menu_option_14() {
menu_option_15() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/centos/8-stream/
echo -e "\nCONFIRM: Build a CentOS Stream 8 Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -456,7 +487,7 @@ menu_option_14() {
echo "Done."
}

menu_option_15() {
menu_option_16() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/centos/7/
echo -e "\nCONFIRM: Build a CentOS Linux 7 Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -487,7 +518,7 @@ menu_option_15() {
echo "Done."
}

menu_option_16() {
menu_option_17() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/sles/15/
echo -e "\nCONFIRM: Build a SUSE Linux Enterprise Server 15 Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -520,7 +551,7 @@ menu_option_16() {
}


menu_option_17() {
menu_option_18() {
INPUT_PATH="$SCRIPT_PATH"/builds/windows/server/2022/
echo -e "\nCONFIRM: Build all Windows Server 2022 Templates for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -549,7 +580,7 @@ menu_option_17() {
echo "Done."
}

menu_option_18() {
menu_option_19() {
INPUT_PATH="$SCRIPT_PATH"/builds/windows/server/2022/
echo -e "\nCONFIRM: Build Microsoft Windows Server 2022 Standard Templates for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -579,7 +610,7 @@ menu_option_18() {
echo "Done."
}

menu_option_19() {
menu_option_20() {
INPUT_PATH="$SCRIPT_PATH"/builds/windows/server/2022/
echo -e "\nCONFIRM: Build Microsoft Windows Server 2022 Datacenter Templates for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -609,7 +640,7 @@ menu_option_19() {
echo "Done."
}

menu_option_20() {
menu_option_21() {
INPUT_PATH="$SCRIPT_PATH"/builds/windows/server/2019/
echo -e "\nCONFIRM: Build all Windows Server 2019 Templates for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -638,7 +669,7 @@ menu_option_20() {
echo "Done."
}

menu_option_21() {
menu_option_22() {
INPUT_PATH="$SCRIPT_PATH"/builds/windows/server/2019/
echo -e "\nCONFIRM: Build Microsoft Windows Server 2019 Standard Templates for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -668,7 +699,7 @@ menu_option_21() {
echo "Done."
}

menu_option_22() {
menu_option_23() {
INPUT_PATH="$SCRIPT_PATH"/builds/windows/server/2019/
echo -e "\nCONFIRM: Build Microsoft Windows Server 2019 Datacenter Templates for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -698,7 +729,7 @@ menu_option_22() {
echo "Done."
}

menu_option_23() {
menu_option_24() {
INPUT_PATH="$SCRIPT_PATH"/builds/windows/desktop/11/
echo -e "\nCONFIRM: Build a Windows 11 Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -727,7 +758,7 @@ menu_option_23() {
echo "Done."
}

menu_option_24() {
menu_option_25() {
INPUT_PATH="$SCRIPT_PATH"/builds/windows/desktop/10/
echo -e "\nCONFIRM: Build a Windows 10 Template for VMware vSphere?"
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -791,31 +822,32 @@ until [ "$selection" = "0" ]; do
echo ""
echo " 1 - VMware Photon OS 5"
echo " 2 - VMware Photon OS 4"
echo " 3 - Debian 11"
echo " 4 - Ubuntu Server 22.04 LTS (cloud-init)"
echo " 5 - Ubuntu Server 20.04 LTS (cloud-init)"
echo " 6 - Red Hat Enterprise Linux 9"
echo " 7 - Red Hat Enterprise Linux 8"
echo " 8 - Red Hat Enterprise Linux 7"
echo " 9 - AlmaLinux OS 9"
echo " 10 - AlmaLinux OS 8"
echo " 11 - Rocky Linux 9"
echo " 12 - Rocky Linux 8"
echo " 13 - CentOS Stream 9"
echo " 14 - CentOS Stream 8"
echo " 15 - CentOS Linux 7"
echo " 16 - SUSE Linux Enterprise Server 15"
echo " 3 - Debian 12"
echo " 4 - Debian 11"
echo " 5 - Ubuntu Server 22.04 LTS (cloud-init)"
echo " 6 - Ubuntu Server 20.04 LTS (cloud-init)"
echo " 7 - Red Hat Enterprise Linux 9"
echo " 8 - Red Hat Enterprise Linux 8"
echo " 9 - Red Hat Enterprise Linux 7"
echo " 10 - AlmaLinux OS 9"
echo " 11 - AlmaLinux OS 8"
echo " 12 - Rocky Linux 9"
echo " 13 - Rocky Linux 8"
echo " 14 - CentOS Stream 9"
echo " 15 - CentOS Stream 8"
echo " 16 - CentOS Linux 7"
echo " 17 - SUSE Linux Enterprise Server 15"
echo ""
echo " Microsoft Windows:"
echo ""
echo " 17 - Windows Server 2022 - All"
echo " 18 - Windows Server 2022 - Standard Only"
echo " 19 - Windows Server 2022 - Datacenter Only"
echo " 20 - Windows Server 2019 - All"
echo " 21 - Windows Server 2019 - Standard Only"
echo " 22 - Windows Server 2019 - Datacenter Only"
echo " 23 - Windows 11"
echo " 24 - Windows 10"
echo " 18 - Windows Server 2022 - All"
echo " 19 - Windows Server 2022 - Standard Only"
echo " 20 - Windows Server 2022 - Datacenter Only"
echo " 21 - Windows Server 2019 - All"
echo " 22 - Windows Server 2019 - Standard Only"
echo " 23 - Windows Server 2019 - Datacenter Only"
echo " 24 - Windows 11"
echo " 25 - Windows 10"
echo ""
echo " Other:"
echo ""
Expand Down Expand Up @@ -849,6 +881,7 @@ until [ "$selection" = "0" ]; do
22 ) clear ; menu_option_22 ; press_enter ;;
23 ) clear ; menu_option_23 ; press_enter ;;
24 ) clear ; menu_option_24 ; press_enter ;;
25 ) clear ; menu_option_25 ; press_enter ;;
I ) clear ; info ; press_enter ;;
Q ) clear ; exit ;;
* ) clear ; incorrect_selection ; press_enter ;;
Expand Down
3 changes: 3 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ menu:
- entry: "VMware Photon OS 4"
build:
path: "builds/linux/photon/4/"
- entry: "Debian 12"
build:
path: "builds/linux/debian/12/"
- entry: "Debian 11"
build:
path: "builds/linux/debian/11/"
Expand Down
5 changes: 3 additions & 2 deletions builds/linux/debian/11/data/ks.pkrtpl.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

# Debian 11
# Debian 11 (Bullseye) Preseed File
# https://www.debian.org/releases/bullseye/amd64/

# Locale and Keyboard
d-i debian-installer/locale string ${vm_guest_os_language}
Expand Down Expand Up @@ -158,7 +159,7 @@ d-i netcfg/get_domain string unassigned-domain

# Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string ftp.it.debian.org
d-i mirror/http/hostname string cdn-fastly.deb.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string

Expand Down
2 changes: 1 addition & 1 deletion builds/linux/debian/11/linux-debian.auto.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
DESCRIPTION:
Debian 11 variables used by the Packer Plugin for VMware vSphere (vsphere-iso).
Debian 11 (Bullseye) build variables.
*/

// Guest Operating System Metadata
Expand Down
3 changes: 2 additions & 1 deletion builds/linux/debian/11/linux-debian.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
DESCRIPTION:
Debian Linux 11 template using the Packer Builder for VMware vSphere (vsphere-iso).
Debian 11 (Bullseye) build definition.
Packer Plugin for VMware vSphere (`vsphere-iso` builder).
*/

// BLOCK: packer
Expand Down
3 changes: 2 additions & 1 deletion builds/linux/debian/11/variables.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
DESCRIPTION:
Debian 11 variables using the Packer Builder for VMware vSphere (vsphere-iso).
Debian 11 (Bullseye) input variables.
Packer Plugin for VMware vSphere (`vsphere-iso` builder).
*/

// BLOCK: variable
Expand Down
Loading

0 comments on commit cd74584

Please sign in to comment.