job "certificates" { type = "batch" periodic { cron = "@monthly" } group "lego" { restart { attempts = 1 delay = "1h" } volume "certs" { type = "host" source = "ca-certificates" } network { port "http" { } } service { name = "certificates" port = "http" provider = "nomad" tags = [ "nginx.acme-challenge", ] } task "lego" { driver = "exec" volume_mount { volume = "certs" destination = "/lego" } config { command = "certs.sh" } template { data = <