Add ability to set priority for service templates
This commit is contained in:
parent
2a1a7fb6b7
commit
cdbd6a9cb3
@ -1,6 +1,7 @@
|
|||||||
resource "nomad_job" "service" {
|
resource "nomad_job" "service" {
|
||||||
jobspec = templatefile("${path.module}/service_template.nomad", {
|
jobspec = templatefile("${path.module}/service_template.nomad", {
|
||||||
name = var.name
|
name = var.name
|
||||||
|
priority = var.priority
|
||||||
image = var.image
|
image = var.image
|
||||||
image_pull_timeout = var.image_pull_timeout
|
image_pull_timeout = var.image_pull_timeout
|
||||||
args = var.args
|
args = var.args
|
||||||
|
@ -3,6 +3,7 @@ job "${name}" {
|
|||||||
datacenters = ["dc1"]
|
datacenters = ["dc1"]
|
||||||
|
|
||||||
type = "service"
|
type = "service"
|
||||||
|
priority = ${priority}
|
||||||
|
|
||||||
group "${name}" {
|
group "${name}" {
|
||||||
network {
|
network {
|
||||||
|
@ -3,6 +3,13 @@ variable "name" {
|
|||||||
description = "Name of the service"
|
description = "Name of the service"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "priority" {
|
||||||
|
type = number
|
||||||
|
default = 50
|
||||||
|
description = "Scheduler priority of the service"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
variable "image" {
|
variable "image" {
|
||||||
type = string
|
type = string
|
||||||
description = "Image that should be run"
|
description = "Image that should be run"
|
||||||
|
Loading…
Reference in New Issue
Block a user