summaryrefslogtreecommitdiff
path: root/tofu/lots/main.tf
diff options
context:
space:
mode:
authorjerome <jerome@xlinfo.fr>2025-08-18 11:22:14 +0200
committerjerome <jerome@xlinfo.fr>2025-08-18 11:22:14 +0200
commit4293df73e636a3bb9097d4cbe80ae8c194862f6b (patch)
treec7cbf89deac7fcbc85850938b7c926778999c9bc /tofu/lots/main.tf
downloadincus-4293df73e636a3bb9097d4cbe80ae8c194862f6b.tar.gz
incus-4293df73e636a3bb9097d4cbe80ae8c194862f6b.zip
commit initial
Diffstat (limited to 'tofu/lots/main.tf')
-rw-r--r--tofu/lots/main.tf30
1 files changed, 30 insertions, 0 deletions
diff --git a/tofu/lots/main.tf b/tofu/lots/main.tf
new file mode 100644
index 0000000..7917a03
--- /dev/null
+++ b/tofu/lots/main.tf
@@ -0,0 +1,30 @@
+terraform {
+ required_providers {
+ incus = {
+ source = "lxc/incus"
+ version = "0.3.1"
+ }
+ }
+}
+
+provider "incus" {
+ # Configuration options
+}
+
+resource "incus_instance" "instance" {
+ name = "${var.nom}${count.index + 1}"
+ project = "Lab"
+ image = var.image
+ count = var.nb
+ wait_for {
+ type = "ipv4"
+ }
+}
+
+output "instance_ip" {
+ value = {
+ for instance in incus_instance.instance :
+ instance.name => instance.ipv4_address
+ }
+}
+