Add plex2m3u

This commit is contained in:
IamTheFij 2025-03-05 16:50:05 -08:00
parent 96ad4c874d
commit 81e79f6030
3 changed files with 53 additions and 0 deletions

View File

@ -111,6 +111,8 @@ nomad/jobs/photoprism:
db_pass: VALUE
db_user: VALUE
oidc_secret: VALUE
nomad/jobs/plex2m3u:
plex_token: VALUE
nomad/jobs/postgres-server:
superuser: VALUE
superuser_pass: VALUE

48
services/plex2m3u.nomad Normal file
View File

@ -0,0 +1,48 @@
job "plex2m3u" {
type = "batch"
periodic {
cron = "30 * * * * *"
prohibit_overlap = true
}
meta = {
"diun.enable" = false
}
group "main" {
volume "media-write" {
type = "host"
read_only = false
source = "media-write"
}
task "main" {
driver = "docker"
config {
image = "iamthefij/plex2m3u:1"
}
volume_mount {
volume = "media-write"
destination = "/media"
read_only = false
}
template {
data = <<EOH
{{ with nomadVar "nomad/jobs/plex2m3u" }}
PLEX_URL=http://192.168.2.10:32400
PLEX_TOKEN={{ .plex_token }}
OUTPUT_DIR=/media/Music/Playlists
{{ end }}
EOH
destination = "${NOMAD_SECRETS_DIR}/config.env"
env = true
}
}
}
}

3
services/plex2m3u.tf Normal file
View File

@ -0,0 +1,3 @@
resource "nomad_job" "plex2m3u" {
jobspec = file("${path.module}/plex2m3u.nomad")
}