Properly persistent configs

This commit is contained in:
2025-05-06 00:23:19 +10:00
parent b13a52233a
commit 805636f44c
9 changed files with 128 additions and 1108 deletions

View File

@@ -3,6 +3,21 @@ provider "nomad" {
address = "http://jaglan-beta-m01:4646"
}
terraform {
required_providers {
sops = {
source = "carlpett/sops"
version = "~> 0.5"
}
}
}
terraform {
backend "local" {
path = "./.tfstate/terraform.tfstate"
}
}
resource "nomad_job" "glance" {
jobspec = file("glance.nomad.hcl")
}
@@ -51,11 +66,6 @@ resource "nomad_csi_volume_registration" "unraid_transfer" {
source = "//192.168.1.192/transfer"
}
parameters = {
"csi.storage.k8s.io/node-stage-secret-name" = "smbcreds"
"csi.storage.k8s.io/node-stage-secret-namespace" = "default"
}
secrets = {
"username" = "anon"
"password" = ""
@@ -65,3 +75,33 @@ resource "nomad_csi_volume_registration" "unraid_transfer" {
resource "nomad_job" "transfer" {
jobspec = file("transfer.nomad.hcl")
}
data "sops_file" "secrets" {
source_file = "secrets.enc.json"
}
resource "nomad_csi_volume_registration" "unraid_appdata_transferfilebrowser" {
#Note: Before chaning the definition of this volume you need to stop the jobs that are using it
depends_on = [data.nomad_plugin.smb]
plugin_id = "smb"
volume_id = "unraid_appdata_transferfilebrowser"
name = "unraid_appdata_transferfilebrowser"
external_id = "unraid_appdata_transferfilebrowser"
capability {
access_mode = "single-node-writer"
attachment_mode = "file-system"
}
context = {
source = "//192.168.1.192/appdata"
subDir = "transferfilebrowser" # Note: Needs to be manually created on the share
}
secrets = {
"username" = "nomad"
"password" = data.sops_file.secrets.data["unraid.nomad"]
}
}