mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-22 20:26:44 +00:00
61 lines
1.9 KiB
Bash
61 lines
1.9 KiB
Bash
# Proxmox Template Builder — Environment Configuration
|
|
#
|
|
# Copy to .env and fill in your values:
|
|
# cp .env.example .env
|
|
#
|
|
# Then source it before running tofu:
|
|
# source .env && tofu plan
|
|
|
|
# --- Proxmox API ---
|
|
|
|
# API token for Proxmox VE (read by the provider directly)
|
|
export PROXMOX_VE_API_TOKEN="terraform@pve!provider=YOUR_TOKEN_HERE"
|
|
|
|
# Proxmox VE API endpoint URL
|
|
export TF_VAR_proxmox_endpoint="https://pve-host.example.com:8006/"
|
|
|
|
# --- Proxmox Node ---
|
|
# Build the template on ONE node. After creation, use vzdump to copy to others.
|
|
#
|
|
# name - Proxmox node name (as shown in the Proxmox UI)
|
|
# address - SSH-reachable hostname or IP of the Proxmox host
|
|
|
|
export TF_VAR_proxmox_node_name="node1"
|
|
export TF_VAR_proxmox_node_address="node1.example.com"
|
|
|
|
# --- SSH Access ---
|
|
|
|
# SSH username on Proxmox hosts (used by provider for file uploads + qm commands)
|
|
export TF_VAR_proxmox_ssh_username="terraform"
|
|
|
|
# Path to SSH private key for Proxmox host access
|
|
export TF_VAR_ssh_private_key_path="~/.ssh/proxmox-host-tf"
|
|
|
|
# Path to SSH private key for VM access (must be the pair of the public key below)
|
|
export TF_VAR_vm_ssh_private_key_path="~/.ssh/cloud-init"
|
|
|
|
# Path to SSH public key injected into VMs via cloud-init (for tf-user)
|
|
export TF_VAR_ssh_public_key_path="~/.ssh/cloud-init.pub"
|
|
|
|
# --- Template ---
|
|
|
|
# VM ID for the template (pick a high number to avoid conflicts)
|
|
export TF_VAR_template_vmid=9000
|
|
|
|
# Short tag for the base image (used in Proxmox template tags)
|
|
export TF_VAR_base_image_tag="debian-12"
|
|
|
|
# Storage and network for the build node
|
|
export TF_VAR_datastore_id="local-lvm"
|
|
export TF_VAR_bridge="vmbr0"
|
|
|
|
# --- Optional ---
|
|
|
|
# Base image — change this when testing a newer Debian/Ubuntu version:
|
|
# export TF_VAR_base_image="local:iso/debian-13-genericcloud-amd64.img"
|
|
# export TF_VAR_base_image_tag="debian-13"
|
|
# export TF_VAR_template_vmid=9010
|
|
|
|
# Clone a specific branch instead of main:
|
|
# export TF_VAR_git_branch="feature/my-branch"
|