Initial work on db backups

This commit is contained in:
2025-05-17 00:38:02 +10:00
parent c6925362a6
commit 08a2e458b2
2 changed files with 106 additions and 0 deletions

View File

@@ -88,6 +88,31 @@ data "sops_file" "secrets" {
source_file = "secrets.enc.json"
}
resource "nomad_csi_volume_registration" "unraid_database_dump" {
#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_database_dump"
name = "unraid_database_dump"
external_id = "unraid_database_dump"
capability {
access_mode = "single-node-writer"
attachment_mode = "file-system"
}
context = {
source = "//192.168.1.192/database-dump"
}
secrets = {
"username" = "nomad"
"password" = data.sops_file.secrets.data["unraid.nomad"]
}
}
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]
@@ -113,3 +138,7 @@ resource "nomad_csi_volume_registration" "unraid_appdata_transferfilebrowser" {
"password" = data.sops_file.secrets.data["unraid.nomad"]
}
}
resource "nomad_job" "pgbackup" {
jobspec = file("pgbackup.nomad.hcl")
}