about summary refs log tree commit diff
path: root/terraform/plan9-cluster.hcl
diff options
context:
space:
mode:
authormakefunstuff <[email protected]>2024-07-18 21:32:36 +0200
committermakefunstuff <[email protected]>2024-07-18 21:32:36 +0200
commit806607a58675a3f28694602b16762f9cdd5dac60 (patch)
treea0fc3b03159e608e115de68785192d2c54480d28 /terraform/plan9-cluster.hcl
parent07822ea3f2239cf9cd3335ad2d7fb0aab7a3e1dc (diff)
downloadk3s-lab-806607a58675a3f28694602b16762f9cdd5dac60.tar.gz
ansible
Diffstat (limited to '')
-rw-r--r--terraform/plan9-cluster.hcl52
1 files changed, 52 insertions, 0 deletions
diff --git a/terraform/plan9-cluster.hcl b/terraform/plan9-cluster.hcl
new file mode 100644
index 0000000..93b9eec
--- /dev/null
+++ b/terraform/plan9-cluster.hcl
@@ -0,0 +1,52 @@
+provider "libvirt" {
+  uri = "qemu:///system"
+}
+
+resource "libvirt_volume" "plan9_image" {
+  name   = "plan9-image"
+  pool   = "default"
+  source = "/path/to/plan9.iso"
+  format = "raw"
+}
+
+resource "libvirt_network" "plan9_network" {
+  name = "plan9-network"
+  mode = "nat"
+  addresses = ["192.168.123.0/24"]
+}
+
+resource "libvirt_domain" "plan9_node" {
+  count  = 3
+  name   = "plan9-node-${count.index + 1}"
+  memory = "512"
+  vcpu   = 1
+
+  network_interface {
+    network_name = libvirt_network.plan9_network.name
+  }
+
+  disk {
+    volume_id = libvirt_volume.plan9_image.id
+  }
+
+  console {
+    type        = "pty"
+    target_type = "serial"
+    target_port = "0"
+  }
+
+  graphics {
+    type        = "vnc"
+    listen_type = "address"
+    listen_address = "127.0.0.1"
+  }
+
+  # Cloud-init is not applicable for Plan 9; manual configuration will be required
+}
+
+output "plan9_node_ips" {
+  value = {
+    for i in libvirt_domain.plan9_node: i.name => i.network_interface[0].addresses[0]
+  }
+}
+