Packer templates with ready-to-run GitHub Actions for building Windows and Linux images on VMware vSphere.
- Overview
- Architecture at a glance
- Features
- Prerequisites
- Quick start
- Repository structure
- Templates included
- Integration with Terraform deployment repository
- Workflows
- Inputs and secrets
- Troubleshooting
- Licence
- Security
- Contributing
- Support
This repository forms the first part of an infrastructure as code pipeline. It automates the creation of vSphere VM templates for multiple operating systems. These templates are intended to be consumed by the companion Terraform repository for downstream deployments.
Note
Each template directory contains its own README with exact usage, variables and any prerequisites. All builds are executed via GitHub Actions using a self hosted runner.
- Packer templates for VMware vSphere
- GitHub Actions workflows to drive
packer init,packer validateandpacker build - Self hosted GitHub runner recommended for access to vSphere networks
- Parameterised builds via workflow inputs and repository or organisation secrets
- Multi OS support including Ubuntu, Rocky Linux and Windows Server variants
- Opinionated build steps for vSphere images with custom post processors where applicable
- Consistent tagging and naming to simplify later selection by Terraform modules
- Modular layout per OS with per template READMEs
- VMware vSphere environment with credentials and permissions to build templates
- A self hosted GitHub runner with network access to vSphere
- ISO sources or content library entries as required by each template
- Repository or organisation secrets configured for vSphere credentials and template variables
- Fork or clone this repository.
- Review the README in the target template directory for OS specific guidance.
- Configure required secrets in your repository or organisation.
- From the Actions tab, choose the workflow for your template and run it with the required inputs.
.
├── .github/ # GitHub Actions workflows
├── templates/ # Packer templates grouped by OS
│ ├── ubuntu/
│ ├── rocky/
│ └── windows/
├── .devcontainer/ # Optional devcontainer setup
├── .vscode/ # Editor settings
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── SECURITY.md
└── README.md
Typical images provided include:
- Ubuntu LTS releases
- Rocky Linux releases
- Windows Server releases
Refer to each template’s README for the exact versions, variables and build steps.
The templates created here are used directly by the Terraform modules in the companion repository:
This integration lets you move from image creation to VM deployment with a consistent set of inputs.
Note
Build the required templates here first, then run the Terraform workflows to deploy VMs that consume those templates.
The workflows provided will:
- Run
packer initandpacker validatefor the selected template. - Execute
packer buildwith inputs supplied through the workflow form. - Publish the resulting template to your vSphere environment.
Common secrets and inputs:
- vSphere
VSPHERE_SERVERVSPHERE_USERVSPHERE_PASSWORD- Datacentre, cluster, datastore and network names as inputs
- Template specific
- ISO URLs or content library names
- Guest customisation values such as admin credentials or SSH keys
Names and scopes vary by template. Always check the template’s README for authoritative details.
- Validation fails
Ensure all required inputs are provided and the template specific variables match your environment. - Build cannot reach ISO or network
Confirm the self hosted runner can access required networks and repositories. - Template not visible after build
Verify permissions on the destination datastore or content library and confirm naming conventions.
This project is licensed under the MIT Licence. See the LICENCE file for details.
If you discover a security issue, please review and follow the guidance in SECURITY.md, or open a private security focused issue with minimal details and request a secure contact channel.
Feel free to open issues or submit pull requests if you have suggestions or improvements.
See CONTRIBUTING.md
Open an issue with as much detail as possible, including the template you used, workflow inputs and any logs that help reproduce the problem.