Add ability to set priority for service templates

This commit is contained in:
IamTheFij 2023-07-06 17:23:20 -07:00
parent 2a1a7fb6b7
commit cdbd6a9cb3
3 changed files with 9 additions and 0 deletions

View File

@ -1,6 +1,7 @@
resource "nomad_job" "service" {
jobspec = templatefile("${path.module}/service_template.nomad", {
name = var.name
priority = var.priority
image = var.image
image_pull_timeout = var.image_pull_timeout
args = var.args

View File

@ -3,6 +3,7 @@ job "${name}" {
datacenters = ["dc1"]
type = "service"
priority = ${priority}
group "${name}" {
network {

View File

@ -3,6 +3,13 @@ variable "name" {
description = "Name of the service"
}
variable "priority" {
type = number
default = 50
description = "Scheduler priority of the service"
}
variable "image" {
type = string
description = "Image that should be run"