cluster/nomad/regions/homelab-1/baikal.tf
Magic_RB 5ed9ee1903
Terraform: add flake_ref to allow for branches
Signed-off-by: Magic_RB <magic_rb@redalder.org>
2022-09-18 18:33:26 +02:00

58 lines
1.2 KiB
HCL

resource "nomad_volume" "baikal-specific" {
type = "csi"
plugin_id = "nfs"
volume_id = "baikal-specific"
name = "baikal-specific"
external_id = "baikal-specific"
capability {
access_mode = "single-node-writer"
attachment_mode = "file-system"
}
context = {
server = "blowhole.hosts.in.redalder.org"
share = "/var/nfs/baikal/specific"
}
mount_options {
fs_type = "nfs"
mount_flags = [ "nolock", "hard" ]
}
}
resource "nomad_volume" "baikal-config" {
type = "csi"
plugin_id = "nfs"
volume_id = "baikal-config"
name = "baikal-config"
external_id = "baikal-config"
capability {
access_mode = "single-node-writer"
attachment_mode = "file-system"
}
context = {
server = "blowhole.hosts.in.redalder.org"
share = "/var/nfs/baikal/config"
}
mount_options {
fs_type = "nfs"
mount_flags = [ "nolock", "hard" ]
}
}
resource "nomad_job" "baikal" {
jobspec = file("${path.module}/job/baikal.hcl")
hcl2 {
enabled = true
vars = {
flake_ref = "${var.flake_host}?rev=${var.flake_rev}&ref=${var.flake_ref}"
flake_sha = var.flake_sha
}
}
}