diff options
author | makefunstuff <[email protected]> | 2024-07-18 21:32:36 +0200 |
---|---|---|
committer | makefunstuff <[email protected]> | 2024-07-18 21:32:36 +0200 |
commit | 806607a58675a3f28694602b16762f9cdd5dac60 (patch) | |
tree | a0fc3b03159e608e115de68785192d2c54480d28 /terraform | |
parent | 07822ea3f2239cf9cd3335ad2d7fb0aab7a3e1dc (diff) | |
download | k3s-lab-806607a58675a3f28694602b16762f9cdd5dac60.tar.gz |
ansible
Diffstat (limited to 'terraform')
-rw-r--r-- | terraform/plan9-cluster.hcl | 52 |
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] + } +} + |