Private
Public Access
2
0
This commit is contained in:
2026-01-20 17:40:16 +03:00
parent cda556eec6
commit b78da80550
83 changed files with 108 additions and 82 deletions

5
example/tofu/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
.terraform/
.terraform.lock.hcl
.terraform.tfstate.lock.info
terraform.tfstate
terraform.tfstate.backup

View File

@@ -0,0 +1,4 @@
users:
- name: "root"
ssh_authorized_keys:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOHAAcWecBuLe9gt/NLC5b3DCl68knbwCFcHrH9wPPTk seb@itik.fr"

View File

@@ -0,0 +1,10 @@
vms = {
waf1 = {},
waf2 = {},
waf3 = {},
sql1 = {},
nfs1 = {},
www1 = {},
www2 = {},
www3 = {},
}

11
example/tofu/main.tf Normal file
View File

@@ -0,0 +1,11 @@
provider "multipass" {}
resource "multipass_instance" "this" {
for_each = var.vms
name = each.key
cpus = each.value.cpus
memory = each.value.memory
disk = each.value.disk
image = each.value.image
cloudinit_file = "cloud-init.yml"
}

View File

@@ -0,0 +1,8 @@
terraform {
required_providers {
multipass = {
source = "larstobi/multipass"
version = "1.4.3"
}
}
}

View File

@@ -0,0 +1,9 @@
variable "vms" {
description = "Liste des machines virtuelles"
type = map(object({
cpus = optional(number, 2),
memory = optional(string, "3g"),
disk = optional(string, "12g"),
image = optional(string, "24.04"),
}))
}