packer/README.md

54 lines
1.4 KiB
Markdown

# Packer based PVE image templates
## Table of Contents
- [Packer based PVE image templates](#packer-based-pve-image-templates)
- [Table of Contents](#table-of-contents)
- [Initial Setup](#initial-setup)
- [Create Token](#create-token)
- [Initialize Packer](#initialize-packer)
- [Build](#build)
- [Setup new templates](#setup-new-templates)
## Initial Setup
### Create Token
1. Copy `template-credentials.pkr.hcl` to `credentials.auto.pkrvars.hcl`
2. Open your Proxmox VE web interface & Login.
3. Navigate to: `Datacenter` -> `Permissions` -> `API Tokens`
4. **Click:** Add
5. **Configure in the dialog:**
1. **User:** `root@pam` (or the user you like, but It needs administrative permissions)
2. **Token ID:** `packer`
3. **Privilege Separation:** false
6. **Click:** Add
7. Copy the displayed Token ID and Token Secret to `credentials.auto.pkrvars.hcl`
### Initialize Packer
Run `packer init` to initialize Packer according to a HCL template
configuration. It's downloads and installs the required Plugins according to
the required_plugins block in Packer templates.
```shell
mise run init <path-to-template-directory>
```
## Build
To build a template run:
```shell
mise run build <path-to-template-directory>
```
## Setup new templates
Run:
```shell
mise run setup <distribution name> <version>
```
E.g. `mise run setup debian 13-trixie` or `mise run setup nixos 25.11`.