proxmox: add VM automation with OpenTofu and Ansible
Add automated workflow for building and deploying NixOS VMs on Proxmox including template2 host configuration, Ansible playbook for image building/deployment, and OpenTofu configuration for VM provisioning with cloud-init. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
37
terraform/README.md
Normal file
37
terraform/README.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# OpenTofu Configuration for Proxmox
|
||||
|
||||
This directory contains OpenTofu configuration for managing Proxmox VMs.
|
||||
|
||||
## Setup
|
||||
|
||||
1. **Create a Proxmox API token:**
|
||||
- Log into Proxmox web UI
|
||||
- Go to Datacenter → Permissions → API Tokens
|
||||
- Click Add
|
||||
- User: `root@pam`, Token ID: `terraform`
|
||||
- Uncheck "Privilege Separation"
|
||||
- Save the token secret (shown only once)
|
||||
|
||||
2. **Configure credentials:**
|
||||
```bash
|
||||
cd terraform
|
||||
cp terraform.tfvars.example terraform.tfvars
|
||||
# Edit terraform.tfvars with your Proxmox details
|
||||
```
|
||||
|
||||
3. **Initialize OpenTofu:**
|
||||
```bash
|
||||
tofu init
|
||||
```
|
||||
|
||||
4. **Test connection:**
|
||||
```bash
|
||||
tofu plan
|
||||
```
|
||||
|
||||
## Files
|
||||
|
||||
- `main.tf` - Provider configuration and test data source
|
||||
- `variables.tf` - Variable definitions
|
||||
- `terraform.tfvars.example` - Example credentials file
|
||||
- `terraform.tfvars` - Your actual credentials (gitignored)
|
||||
Reference in New Issue
Block a user