Format terraform and nomad files

This commit is contained in:
2025-05-18 21:28:24 +10:00
parent 837cfdae68
commit 9cdd529633
12 changed files with 80 additions and 72 deletions

View File

@@ -2,8 +2,8 @@ job "pgbackup" {
type = "batch"
periodic {
# Note: To avoid issues with daylight savings, avoid scheduling jobs at 2am +/- 1 hour
cron = "* 04 * * *" # Every day at 4am
time_zone = "Australia/Melbourne"
cron = "* 04 * * *" # Every day at 4am
time_zone = "Australia/Melbourne"
prohibit_overlap = true
}
@@ -25,17 +25,17 @@ job "pgbackup" {
driver = "docker"
config {
image = "postgres:latest"
image = "postgres:latest"
command = "/bin/bash"
args = ["-c", "pg_dumpall -h localhost -U postgres > /backup/all_databases.sql"]
volumes = [ "secrets/postgres_password:/run/secrets/postgres_password" ]
args = ["-c", "pg_dumpall -h localhost -U postgres > /backup/all_databases.sql"]
volumes = ["secrets/postgres_password:/run/secrets/postgres_password"]
}
user = "1000"
volume_mount {
volume = "unraid_database_dump"
destination = "/backup"
destination = "/backup"
read_only = false
}
@@ -44,12 +44,12 @@ job "pgbackup" {
}
template {
data = <<EOF
data = <<EOF
localhost:5432:*:postgres:{{ with nomadVar "nomad/jobs/postgres" }}{{ .postgress_password }}{{ end }}
EOF
destination = "/secrets/postgres_password"
perms = "0400"
uid = 1000
perms = "0400"
uid = 1000
}
resources {
@@ -59,14 +59,14 @@ EOF
}
volume "unraid_database_dump" {
type = "csi"
read_only = false
source = "unraid_database_dump"
type = "csi"
read_only = false
source = "unraid_database_dump"
access_mode = "single-node-writer"
attachment_mode = "file-system"
mount_options {
mount_flags = ["uid=1000","gid=0"]
mount_flags = ["uid=1000", "gid=0"]
}
}