diff --git a/forgejo.tf b/forgejo.tf new file mode 100644 index 0000000..1d1c18d --- /dev/null +++ b/forgejo.tf @@ -0,0 +1,19 @@ +resource "incus_storage_volume" "forgejo_var_lib_forgejo" { + name = "forgejo_var_lib_forgejo" + pool = incus_storage_pool.default.name +} + +resource "incus_instance" "forgejo" { + name = "forgejo" + image = "forgejo-8.0.3-1benoitjpnet" + + device { + name = "var_lib_forgejo" + type = "disk" + properties = { + path = "/var/lib/forgejo" + source = incus_storage_volume.forgejo_var_lib_forgejo.name + pool = incus_storage_pool.default.name + } + } +} diff --git a/laminar.tf b/laminar.tf new file mode 100644 index 0000000..22bf794 --- /dev/null +++ b/laminar.tf @@ -0,0 +1,58 @@ +resource "incus_storage_volume" "laminar_var_lib_laminar" { + name = "laminar_var_lib_laminar" + pool = incus_storage_pool.default.name + content_type = "block" + config = { + "size" = "50GiB" + } +} + +resource "incus_storage_volume" "laminar_var_lib_incus" { + name = "laminar_var_lib_incus" + pool = incus_storage_pool.default.name + content_type = "block" + config = { + "size" = "50GiB" + } +} + +resource "incus_instance" "laminar" { + name = "laminar" + image = "images:ubuntu/24.04" + type = "virtual-machine" + + limits = { + cpu = 6 + memory = "6GiB" + } + + device { + name = "root" + type = "disk" + properties = { + size = "25GiB" + path = "/" + pool = incus_storage_pool.default.name + } + } + + device { + name = "var_lib_laminar" + type = "disk" + properties = { + # Need to be done manually on the VM: path = "/var/lib/laminar" + source = incus_storage_volume.laminar_var_lib_laminar.name + pool = incus_storage_pool.default.name + } + } + + device { + name = "var_lib_incus" + type = "disk" + properties = { + # Need to be done manually on the VM: path = "/var/lib/incus" + source = incus_storage_volume.laminar_var_lib_incus.name + pool = incus_storage_pool.default.name + } + } +} diff --git a/main.tf b/main.tf new file mode 100644 index 0000000..592175c --- /dev/null +++ b/main.tf @@ -0,0 +1,11 @@ +terraform { + required_providers { + incus = { + source = "lxc/incus" + #version = "0.1.4" + } + } +} + +provider "incus" { +} diff --git a/storage.tf b/storage.tf new file mode 100644 index 0000000..72f7c7b --- /dev/null +++ b/storage.tf @@ -0,0 +1,5 @@ +resource "incus_storage_pool" "default" { + name = "default" + driver = "zfs" +} +