Skip to content

Commit

Permalink
Adding support for CentOS Stream.
Browse files Browse the repository at this point in the history
Addressing #19.
  • Loading branch information
tenthirtyam committed Jul 22, 2021
1 parent 102dba3 commit 3f1e266
Show file tree
Hide file tree
Showing 5 changed files with 468 additions and 59 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

> Note: GuestOS Customization is not supported in vSphere 7.0 U2.
* Added [support](https://github.com/rainpole/packer-vsphere/issues/19) for [CentOS Stream](https://www.centos.org/centos-stream/) 8.
* Updated scripts for Linux to generate host keys using `ssh-keygen` to ensure `sshd` will start on machine images.

## 2021-07-16
Expand All @@ -29,4 +30,4 @@
* Updated examples to support vSphere datacenter object.

## 2020-11-26
* Initial release.
* Initial release.
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The following builds are automated:
* Red Hat Enterprise Linux Server 7
* AlmaLinux Server 8
* Rocky Linux Server 8
* CentOS Stream 8
* CentOS Server 8
* CentOS Server 7

Expand Down Expand Up @@ -148,6 +149,8 @@ packer-vsphere/
* [Download][download-linux-almalinux-server-8] the latest release of the full (e.g `AlmaLinux-8-x86_64-dvd1.iso`) .iso image.
* Rocky Linux Server 8
* [Download][download-linux-rocky-server-8] the latest release of the full (e.g `Rocky-8-x86_64-dvd1.iso`) .iso image.
* CentOS Stream 8
* [Download][download-linux-centos-stream-8] the latest release of the full (e.g `CentOS-Stream-8-x86_64-dvd1.iso`) .iso image.
* CentOS Server 8
* [Download][download-linux-centos-server-8] the latest release of the full (e.g `CentOS-8-x86_64-dvd1.iso`) .iso image.
* CentOS Server 7
Expand All @@ -169,6 +172,7 @@ packer-vsphere/
* `iso-linux-redhat-server-7`
* `iso-linux-almalinux-server-8`
* `iso-linux-rocky-server-8`
* `iso-linux-centos-stream-8`
* `iso-linux-centos-server-8`
* `iso-linux-centos-server-7`
* `iso-windows-server-2019.iso`
Expand Down Expand Up @@ -642,21 +646,22 @@ The menu will allow you to execute and confirm a build using Packer and the `vsp
Linux Distribution:
1 - VMware Photon OS 4
2 - VMware Photon OS 3
1 - VMware Photon OS 4 Server
2 - VMware Photon OS 3 Server
3 - Ubuntu Server 20.04 LTS
4 - Ubuntu Server 18.04 LTS
5 - Red Hat Enterprise Linux Server 8
6 - Red Hat Enterprise Linux Server 7
7 - AlmaLinux Server 8
8 - Rocky Linux Server 8
9 - CentOS Server 8
10 - CentOS Server 7
5 - Red Hat Enterprise Linux 8 Server
6 - Red Hat Enterprise Linux 8 Server
7 - AlmaLinux 8 Server
8 - Rocky Linux 8 Server
9 - CentOS Stream 8 Server
10 - CentOS Linux 8 Server
11 - CentOS Linux 7 Server
Microsoft Windows:
12 - Windows Server 2019 - All
11 - Windows Server 2019 - All
12 - Windows Server 2019 - Standard Only
13 - Windows Server 2019 - Datacenter Only
14 - Windows Server 2016 - All
Expand Down Expand Up @@ -716,6 +721,7 @@ Happy building!!!
[download-linux-redhat-server-7]: https://access.redhat.com/downloads/content/69/
[download-linux-almalinux-server-8]: https://mirrors.almalinux.org/isos.html
[download-linux-rocky-server-8]: https://download.rockylinux.org/pub/rocky/8/isos/x86_64/
[download-linux-centos-stream-8]: http:https://isoredirect.centos.org/centos/8-stream/isos/x86_64/
[download-linux-centos-server-8]: http:https://isoredirect.centos.org/centos/8/isos/x86_64/
[download-linux-centos-server-7]: http:https://isoredirect.centos.org/centos/7/isos/x86_64/
[hashicorp]: https://www.hashicorp.com/
Expand All @@ -739,4 +745,4 @@ Happy building!!!
[vsphere-content-library]: https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-254B2CE8-20A8-43F0-90E8-3F6776C2C896.html
[vsphere-guestosid]: https://vdc-download.vmware.com/vmwb-repository/dcr-public/b50dcbbf-051d-4204-a3e7-e1b618c1e384/538cf2ec-b34f-4bae-a332-3820ef9e7773/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html
[vsphere-efi]: https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.security.doc/GUID-898217D4-689D-4EB5-866C-888353FE241C.html
[vsphere-upload]: https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.storage.doc/GUID-58D77EA5-50D9-4A8E-A15A-D7B3ABA11B87.html?hWord=N4IghgNiBcIK4AcIHswBMAEAzAlhApgM4gC+QA
[vsphere-upload]: https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.storage.doc/GUID-58D77EA5-50D9-4A8E-A15A-D7B3ABA11B87.html?hWord=N4IghgNiBcIK4AcIHswBMAEAzAlhApgM4gC+QA
121 changes: 73 additions & 48 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ BASEDIR=$(pwd)

menu_option_1() {
cd builds/linux/photon-server-4/
echo -e "\nCONFIRM: Build a VMware Photon OS 4 Template for VMware vSphere."
echo -e "\nCONFIRM: Build a VMware Photon OS 4 Server Template for VMware vSphere."
echo -e "\nContinue? (y/n)"
read REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi

### Build a VMware Photon OS 4 Template for VMware vSphere ###
echo "Building a VMware Photon OS 4 Template for VMware vSphere ..."
### Build a VMware Photon OS 4 Server Template for VMware vSphere ###
echo "Building a VMware Photon OS 4 Server Template for VMware vSphere ..."
rm -f output-vmware-iso/*.ova

### Apply the HashiCorp Packer Build ###
Expand All @@ -27,16 +27,16 @@ menu_option_1() {

menu_option_2() {
cd builds/linux/photon-server-3/
echo -e "\nCONFIRM: Build a VMware Photon OS 3 Template for VMware vSphere."
echo -e "\nCONFIRM: Build a VMware Photon OS 3 Server Template for VMware vSphere."
echo -e "\nContinue? (y/n)"
read REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi

### Build a VMware Photon OS 3 Template for VMware vSphere ###
echo "Building a VMware Photon OS 3 Template for VMware vSphere ..."
### Build a VMware Photon OS 3 Server Template for VMware vSphere ###
echo "Building a VMware Photon OS 3 Server Template for VMware vSphere ..."
rm -f output-vmware-iso/*.ova

### Apply the HashiCorp Packer Build ###
Expand All @@ -58,8 +58,8 @@ menu_option_3() {
exit 1
fi

### Build a Ubuntu Sever 20.04 LTS Template for VMware vSphere ###
echo "Building a Ubuntu Sever 20.04 LTS Template for VMware vSphere ..."
### Build a Ubuntu Server 20.04 LTS Template for VMware vSphere ###
echo "Building a Ubuntu Server 20.04 LTS Template for VMware vSphere ..."
rm -f output-vmware-iso/*.ova

### Apply the HashiCorp Packer Build ###
Expand Down Expand Up @@ -96,16 +96,16 @@ menu_option_4() {

menu_option_5() {
cd builds/linux/redhat-server-8/
echo -e "\nCONFIRM: Build a Red Hat Enerprise Linux Server 8 Template for VMware vSphere."
echo -e "\nCONFIRM: Build a Red Hat Enerprise Linux 8 Server Template for VMware vSphere."
echo -e "\nContinue? (y/n)"
read REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi

### Build an Red Hat Enerprise Linux Server 8 Template for VMware vSphere ###
echo "Building a Red Hat Enerprise Linux Server 8 Template for VMware vSphere ..."
### Build an Red Hat Enerprise Linux 8 Server Template for VMware vSphere ###
echo "Building a Red Hat Enerprise Linux 8 Server Template for VMware vSphere ..."
rm -f output-vmware-iso/*.ova

### Apply the HashiCorp Packer Build ###
Expand All @@ -120,16 +120,16 @@ menu_option_5() {

menu_option_6() {
cd builds/linux/redhat-server-7/
echo -e "\nCONFIRM: Build a Red Hat Enerprise Linux Server 7 Template for VMware vSphere."
echo -e "\nCONFIRM: Build a Red Hat Enerprise Linux 7 Server Template for VMware vSphere."
echo -e "\nContinue? (y/n)"
read REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi

### Build an Red Hat Enerprise Linux Server 7 Template for VMware vSphere ###
echo "Building a Red Hat Enerprise Linux Server 7 Template for VMware vSphere ..."
### Build an Red Hat Enerprise Linux 7 Server Template for VMware vSphere ###
echo "Building a Red Hat Enerprise Linux 7 Server Template for VMware vSphere ..."
rm -f output-vmware-iso/*.ova

### Apply the HashiCorp Packer Build ###
Expand All @@ -144,16 +144,16 @@ menu_option_6() {

menu_option_7() {
cd builds/linux/almalinux-server-8/
echo -e "\nCONFIRM: Build an AlmaLinux Server 8 Template for VMware vSphere."
echo -e "\nCONFIRM: Build an AlmaLinux 8 Server Template for VMware vSphere."
echo -e "\nContinue? (y/n)"
read REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi

### Build a Rocky Linux 8 Template for VMware vSphere ###
echo "Building an AlmaLinux Server 8 Template for VMware vSphere ..."
### Build an AlmaLinux 8 Server Template for VMware vSphere ###
echo "Building an AlmaLinux 8 Server Template for VMware vSphere ..."
rm -f output-vmware-iso/*.ova

### Apply the HashiCorp Packer Build ###
Expand All @@ -167,16 +167,16 @@ menu_option_7() {

menu_option_8() {
cd builds/linux/rocky-server-8/
echo -e "\nCONFIRM: Build a Rocky Linux Server 8 Template for VMware vSphere."
echo -e "\nCONFIRM: Build a Rocky Linux 8 Server Template for VMware vSphere."
echo -e "\nContinue? (y/n)"
read REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi

### Build a Rocky Linux 8 Template for VMware vSphere ###
echo "Building a Rocky Linux Server 8 Template for VMware vSphere ..."
### Build a Rocky Linux 8 Server Template for VMware vSphere ###
echo "Building a Rocky Linux 8 Server Template for VMware vSphere ..."
rm -f output-vmware-iso/*.ova

### Apply the HashiCorp Packer Build ###
Expand All @@ -189,17 +189,17 @@ menu_option_8() {
}

menu_option_9() {
cd builds/linux/centos-server-8/
echo -e "\nCONFIRM: Build a CentOS Server 8 Template for VMware vSphere."
cd builds/linux/centos-stream-8/
echo -e "\nCONFIRM: Build a CentOS Stream 8 Server Template for VMware vSphere."
echo -e "\nContinue? (y/n)"
read REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi

### Build n CentOS 8 Template for VMware vSphere ###
echo "Building a CentOS Server 8 Template for VMware vSphere ..."
### Build a CentOS Stream 8 Server Template for VMware vSphere ###
echo "Building a CentOS Stream 8 Server Template for VMware vSphere ..."
rm -f output-vmware-iso/*.ova

### Apply the HashiCorp Packer Build ###
Expand All @@ -212,17 +212,17 @@ menu_option_9() {
}

menu_option_10() {
cd builds/linux/centos-server-7/
echo -e "\nCONFIRM: Build a CentOS Server 7 Template for VMware vSphere."
cd builds/linux/centos-server-8/
echo -e "\nCONFIRM: Build a CentOS Linux 8 Server Template for VMware vSphere."
echo -e "\nContinue? (y/n)"
read REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi

### Build a CentOS Server 7 Template for VMware vSphere ###
echo "Building a CentOS Server 7 Template for VMware vSphere ..."
### Build a CentOS Linux 8 Server Template for VMware vSphere ###
echo "Building a CentOS Linux 8 Server Template for VMware vSphere ..."
rm -f output-vmware-iso/*.ova

### Apply the HashiCorp Packer Build ###
Expand All @@ -235,6 +235,29 @@ menu_option_10() {
}

menu_option_11() {
cd builds/linux/centos-server-7/
echo -e "\nCONFIRM: Build a CentOS Linux 7 Server Template for VMware vSphere."
echo -e "\nContinue? (y/n)"
read REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi

### Build a CentOS Linux 7 Template for VMware vSphere ###
echo "Building a CentOS Linux 7 Server Template for VMware vSphere ..."
rm -f output-vmware-iso/*.ova

### Apply the HashiCorp Packer Build ###
echo "Applying the HashiCorp Packer Build ..."
packer build -force \
-var-file="../../../vsphere.pkrvars.hcl" .

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

menu_option_12() {
cd builds/windows/windows-server-2019/
echo -e "\nCONFIRM: Build all Microsoft Windows Server 2019 Templates for VMware vSphere."
echo -e "\nContinue? (y/n)"
Expand All @@ -257,7 +280,7 @@ menu_option_11() {
echo "Done."
}

menu_option_12() {
menu_option_13() {
cd builds/windows/windows-server-2019/
echo -e "\nCONFIRM: Build a Microsoft Windows Server 2019 Templates for VMware vSphere."
echo -e "\nContinue? (y/n)"
Expand All @@ -281,7 +304,7 @@ menu_option_12() {
echo "Done."
}

menu_option_13() {
menu_option_14() {
cd builds/windows/windows-server-2019/
echo -e "\nCONFIRM: Build a Microsoft Windows Server 2019 Datacenter Templates for VMware vSphere."
echo -e "\nContinue? (y/n)"
Expand All @@ -305,7 +328,7 @@ menu_option_13() {
echo "Done."
}

menu_option_14() {
menu_option_15() {
cd builds/windows/windows-server-2016/
echo -e "\nCONFIRM: Build all Microsoft Windows Server 2016 Templates for VMware vSphere."
echo -e "\nContinue? (y/n)"
Expand All @@ -328,7 +351,7 @@ menu_option_14() {
echo "Done."
}

menu_option_15() {
menu_option_16() {
cd builds/windows/windows-server-2016/
echo -e "\nCONFIRM: Build a Microsoft Windows Server Standard 2016 Templates for VMware vSphere."
echo -e "\nContinue? (y/n)"
Expand All @@ -352,7 +375,7 @@ menu_option_15() {
echo "Done."
}

menu_option_16() {
menu_option_17() {
cd builds/windows/windows-server-2016/
echo -e "\nCONFIRM: Build a Microsoft Windows Server 2016 Datacenter Templates for VMware vSphere."
echo -e "\nContinue? (y/n)"
Expand Down Expand Up @@ -433,26 +456,27 @@ until [ "$selection" = "0" ]; do
echo ""
echo " Linux Distribution:"
echo ""
echo " 1 - VMware Photon OS 4"
echo " 2 - VMware Photon OS 3"
echo " 1 - VMware Photon OS 4 Server"
echo " 2 - VMware Photon OS 3 Server"
echo " 3 - Ubuntu Server 20.04 LTS"
echo " 4 - Ubuntu Server 18.04 LTS"
echo " 5 - Red Hat Enterprise Linux Server 8"
echo " 6 - Red Hat Enterprise Linux Server 7"
echo " 7 - AlmaLinux Server 8"
echo " 8 - Rocky Linux Server 8"
echo " 9 - CentOS Server 8"
echo " 10 - CentOS Server 7"
echo " 5 - Red Hat Enterprise Linux 8 Server"
echo " 6 - Red Hat Enterprise Linux 7 Server"
echo " 7 - AlmaLinux 8 Server"
echo " 8 - Rocky Linux 8 Server"
echo " 9 - CentOS Stream 8 Server"
echo " 10 - CentOS Linux 8 Server"
echo " 11 - CentOS Linux 7 Server"
echo ""
echo ""
echo " Microsoft Windows:"
echo ""
echo " 11 - Windows Server 2019 - All"
echo " 12 - Windows Server 2019 - Standard Only"
echo " 13 - Windows Server 2019 - Datacenter Only"
echo " 14 - Windows Server 2016 - All"
echo " 15 - Windows Server 2016 - Standard Only"
echo " 16 - Windows Server 2016 - Datacenter Only"
echo " 12 - Windows Server 2019 - All"
echo " 13 - Windows Server 2019 - Standard Only"
echo " 14 - Windows Server 2019 - Datacenter Only"
echo " 15 - Windows Server 2016 - All"
echo " 16 - Windows Server 2016 - Standard Only"
echo " 17 - Windows Server 2016 - Datacenter Only"
echo ""
echo ""
echo " Other:"
Expand Down Expand Up @@ -480,9 +504,10 @@ until [ "$selection" = "0" ]; do
14 ) clear ; menu_option_14 ; press_enter ;;
15 ) clear ; menu_option_15 ; press_enter ;;
16 ) clear ; menu_option_16 ; press_enter ;;
17 ) clear ; menu_option_17 ; press_enter ;;
P ) clear ; plugins ; press_enter ;;
I ) clear ; info ; press_enter ;;
Q ) clear ; exit ;;
* ) clear ; incorrect_selection ; press_enter ;;
esac
done
done
Loading

0 comments on commit 3f1e266

Please sign in to comment.