From 806607a58675a3f28694602b16762f9cdd5dac60 Mon Sep 17 00:00:00 2001 From: makefunstuff Date: Thu, 18 Jul 2024 22:32:36 +0300 Subject: ansible --- terraform/plan9-cluster.hcl | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 terraform/plan9-cluster.hcl (limited to 'terraform') 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] + } +} + -- cgit 1.4.1-2-gfad0