Skip to content

About

Terraform provider that builds NoCloud cloud-init ISO9660 images locally for SSH-free upload to Proxmox (pairs with bpg iso upload).

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

terraform-provider-rawdisk

A tiny Terraform provider that builds a NoCloud cloud-init ISO9660 image (cidata) on the local filesystem from user-data / meta-data / network-config strings — the same in-Go ISO build that Telmate's proxmox_cloud_init_disk uses (github.com/kdomanski/iso9660), but without any upload or SSH.

It exists to enable SSH-free cloud-init on Proxmox: build the ISO with this provider, then upload it through the Proxmox API with bpg's proxmox_virtual_environment_file { content_type = "iso" } (API upload, no SSH), and mount it as a cdrom. The Proxmox API does not support uploading snippets — only iso/vztmpl/backup — which is why the snippet path requires SSH and this path does not.

Resource: rawdisk_cloudinit_iso

resource "rawdisk_cloudinit_iso" "ci" {
  user_data      = file("user-data.yaml")
  meta_data      = "instance-id: my-vm\nlocal-hostname: my-vm\n"
  network_config = file("network-config.yaml")
  output_file    = "${path.module}/.cloudinit/my-vm.iso"
}
Argument Description
user_data Written to /user-data on the ISO (optional).
meta_data Written to /meta-data (optional).
network_config Written to /network-config (optional).
vendor_data Written to /vendor-data (optional).
label ISO9660 volume label; NoCloud requires cidata (default).
output_file Local path to write the .iso (required; parent dirs created).

Exported: sha256, size (bytes).

Use with bpg (SSH-free)

resource "proxmox_virtual_environment_file" "ci" {
  content_type = "iso"
  datastore_id = "nfs"
  node_name    = "pve1"
  source_file { path = rawdisk_cloudinit_iso.ci.output_file }
}

resource "proxmox_virtual_environment_vm" "vm" {
  cdrom { file_id = proxmox_virtual_environment_file.ci.id; interface = "ide2" }
}

If your Proxmox API is behind a WAF/CDN (e.g. Cloudflare), point bpg's endpoint at an internal node address that isn't proxied — file upload POSTs are commonly challenged even when API GETs pass.

Local development

make local-install-dev          # build + install to the local plugin mirror
# then in a config: rawdisk = { source = "local/hradaideh/rawdisk", version = "0.1.0" }

License

MPL-2.0

About

Terraform provider that builds NoCloud cloud-init ISO9660 images locally for SSH-free upload to Proxmox (pairs with bpg iso upload).

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages