mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-25 17:46:14 +01:00
5ed9ee1903
Signed-off-by: Magic_RB <magic_rb@redalder.org>
67 lines
1.2 KiB
HCL
67 lines
1.2 KiB
HCL
resource "nomad_volume" "gitea-db" {
|
|
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.hosts.in.redalder.org"
|
|
share = "/var/nfs/gitea-db"
|
|
}
|
|
|
|
mount_options {
|
|
fs_type = "nfs"
|
|
mount_flags = [ "nolock", "hard" ]
|
|
}
|
|
}
|
|
|
|
resource "nomad_volume" "gitea-data" {
|
|
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.hosts.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 = <<EOF
|
|
path "kv/data/gitea" {
|
|
capabilities = ["read"]
|
|
}
|
|
EOF
|
|
}
|
|
|
|
resource "nomad_job" "gitea" {
|
|
jobspec = file("${path.module}/job/gitea.hcl")
|
|
|
|
hcl2 {
|
|
enabled = true
|
|
vars = {
|
|
flake_ref = "${var.flake_host_alt}?rev=${var.flake_rev}&ref=${var.flake_ref}"
|
|
flake_sha = var.flake_sha
|
|
}
|
|
}
|
|
}
|