mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-29 03:26:14 +01:00
78 lines
1.5 KiB
Terraform
78 lines
1.5 KiB
Terraform
|
variable "flake_ref" {
|
||
|
type = string
|
||
|
}
|
||
|
|
||
|
variable "flake_sha" {
|
||
|
type = string
|
||
|
}
|
||
|
|
||
|
# data "nomad_plugin" "nomad-driver-containerd" {
|
||
|
# plugin_id = "nomad-driver-containerd"
|
||
|
# wait_for_healthy = true
|
||
|
# }
|
||
|
|
||
|
resource "nomad_volume" "gitea-db" {
|
||
|
# depends_on = [data.nomad_plugin.nomad-driver-containerd]
|
||
|
type = "csi"
|
||
|
plugin_id = "nfs"
|
||
|
volume_id = "gitea-db"
|
||
|
name = "gitea-db"
|
||
|
external_id = "gitea-db"
|
||
|
|
||
|
capability {
|
||
|
access_mode = "single-node-writer"
|
||
|
attachment_mode = "file-system"
|
||
|
}
|
||
|
|
||
|
context = {
|
||
|
server = "blowhole.in.redalder.org"
|
||
|
share = "/var/nfs/gitea-db"
|
||
|
}
|
||
|
|
||
|
mount_options {
|
||
|
fs_type = "nfs"
|
||
|
mount_flags = [ "nolock", "hard" ]
|
||
|
}
|
||
|
}
|
||
|
|
||
|
resource "nomad_volume" "gitea-data" {
|
||
|
# depends_on = [data.nomad_plugin.nomad-driver-containerd]
|
||
|
type = "csi"
|
||
|
plugin_id = "nfs"
|
||
|
volume_id = "gitea-data"
|
||
|
name = "gitea-data"
|
||
|
external_id = "gitea-data"
|
||
|
|
||
|
capability {
|
||
|
access_mode = "single-node-writer"
|
||
|
attachment_mode = "file-system"
|
||
|
}
|
||
|
|
||
|
context = {
|
||
|
server = "blowhole.in.redalder.org"
|
||
|
share = "/var/nfs/gitea-data"
|
||
|
}
|
||
|
|
||
|
mount_options {
|
||
|
fs_type = "nfs"
|
||
|
mount_flags = [ "nolock", "hard" ]
|
||
|
}
|
||
|
}
|
||
|
|
||
|
resource "vault_policy" "gitea-policy" {
|
||
|
name = "gitea-policy"
|
||
|
policy = file("${path.module}/gitea-policy.hcl")
|
||
|
}
|
||
|
|
||
|
resource "nomad_job" "gitea" {
|
||
|
jobspec = file("${path.module}/nomad.hcl")
|
||
|
|
||
|
hcl2 {
|
||
|
enabled = true
|
||
|
vars = {
|
||
|
flake_ref = var.flake_ref
|
||
|
flake_sha = var.flake_sha
|
||
|
}
|
||
|
}
|
||
|
}
|