8 Commits

Author SHA1 Message Date
7bdaa68778 fixup! test: regenerate testvm01 with correct boot device
All checks were successful
Run nix flake check / flake-check (push) Successful in 2m13s
Regenerate testvm01 configuration using updated create-host templates:
- Boot device now /dev/vda (was /dev/sda)
- Imports ../template2/hardware-configuration.nix (was ../template)

This should fix the GRUB installation error during bootstrap.

Manually restored flake_branch field in terraform/vms.tf since create-host
doesn't manage that field yet.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 17:25:58 +01:00
ca5782ee50 fixup! scripts: fix boot device and hardware-configuration import
Some checks failed
Run nix flake check / flake-check (push) Has been cancelled
Update create-host template to match template2 configuration:
- Change boot device from /dev/sda to /dev/vda (correct for Proxmox VMs)
- Import ../template2/hardware-configuration.nix instead of ../template
- Remove obsolete comment about systemd-boot

This fixes bootstrap failures where GRUB couldn't install to /dev/sda
and filesystem labels didn't match.

All VMs cloned from template2 share the same hardware config, so
importing the shared file avoids duplication.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 17:24:35 +01:00
e23be13186 scripts: fix create-host flake.nix insertion point
Some checks failed
Run nix flake check / flake-check (push) Failing after 14m47s
Fix bug where new hosts were added outside of nixosConfigurations block
instead of inside it.

Issues fixed:
1. Pattern was looking for "packages =" but actual text is "packages = forAllSystems"
2. Replacement was putting new entry AFTER closing brace instead of BEFORE
3. testvm01 was at top-level flake output instead of in nixosConfigurations

Changes:
- Update pattern to match "packages = forAllSystems"
- Put new entry BEFORE the closing brace of nixosConfigurations
- Move testvm01 to correct location inside nixosConfigurations block

Result: nix flake show now correctly shows testvm01 as NixOS configuration

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 17:08:05 +01:00
abb4077f86 terraform: use local storage for cloud-init disks
All checks were successful
Run nix flake check / flake-check (push) Successful in 2m46s
Fix error "500 can't upload to storage type 'zfspool'" by using "local"
storage pool for cloud-init disks instead of the VM's storage pool.

Cloud-init disks require storage that supports ISO/snippet content types,
which zfspool does not. The "local" storage pool (directory-based) supports
this content type.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 16:59:09 +01:00
618ba681fb terraform: fix cloud-init conditional type inconsistency
All checks were successful
Run nix flake check / flake-check (push) Successful in 2m29s
Fix OpenTofu error where static IP and DHCP branches had different object
structures in the subnets array. Move conditional to network_config level
so both branches return complete, consistent yamlencode() results.

Error was: "The true and false result expressions must have consistent types"

Solution: Make network_config itself conditional rather than the subnets
array, ensuring both branches return the same type (string from yamlencode).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 16:54:33 +01:00
e413de6437 docs: update terraform README for cloud-init refactoring
All checks were successful
Run nix flake check / flake-check (push) Successful in 2m29s
Remove mention of .generated/ directory and clarify that cloud-init.tf
manages all cloud-init disks, not just branch-specific ones.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 16:51:41 +01:00
b0c743b093 terraform: refactor cloud-init to use proxmox_cloud_init_disk resource
Replace SSH upload approach with native proxmox_cloud_init_disk resource
for cleaner, more maintainable cloud-init management.

Changes:
- Use proxmox_cloud_init_disk for all VMs (not just branch-specific ones)
- Include SSH keys, network config, and metadata in cloud-init disk
- Conditionally include NIXOS_FLAKE_BRANCH for VMs with flake_branch set
- Replace ide2 cloudinit disk with cdrom reference to cloud-init disk
- Remove built-in cloud-init parameters (ciuser, sshkeys, etc.)
- Remove cicustom parameter (no longer needed)
- Remove proxmox_host variable (no SSH uploads required)
- Remove .gitignore entry for .generated/ directory

Benefits:
- No SSH access to Proxmox required
- All cloud-init config managed in Terraform
- Consistent approach for all VMs
- Cleaner state management

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 16:51:27 +01:00
74071887ad test: add testvm01 for pipeline testing
All checks were successful
Run nix flake check / flake-check (push) Successful in 2m44s
2026-02-01 16:38:13 +01:00

Diff Content Not Available