Add ability to set task identities for service module
This commit is contained in:
parent
e7f740a2d9
commit
b9c35bf18f
@ -8,6 +8,7 @@ resource "nomad_job" "service" {
|
|||||||
args = var.args
|
args = var.args
|
||||||
env = var.env
|
env = var.env
|
||||||
task_meta = var.task_meta
|
task_meta = var.task_meta
|
||||||
|
task_identity = var.task_identity
|
||||||
group_meta = var.group_meta
|
group_meta = var.group_meta
|
||||||
job_meta = var.job_meta
|
job_meta = var.job_meta
|
||||||
constraints = var.constraints
|
constraints = var.constraints
|
||||||
|
@ -225,6 +225,12 @@ EOF
|
|||||||
%{~ endif ~}
|
%{~ endif ~}
|
||||||
}
|
}
|
||||||
%{~ endif ~}
|
%{~ endif ~}
|
||||||
|
%{~ if task_identity != null }
|
||||||
|
identity {
|
||||||
|
env = ${task_identity.env}
|
||||||
|
file = ${task_identity.file}
|
||||||
|
}
|
||||||
|
%{~ endif ~}
|
||||||
}
|
}
|
||||||
%{~ if mysql_bootstrap != null }
|
%{~ if mysql_bootstrap != null }
|
||||||
task "mysql-bootstrap" {
|
task "mysql-bootstrap" {
|
||||||
|
@ -21,7 +21,6 @@ variable "priority" {
|
|||||||
description = "Scheduler priority of the service"
|
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"
|
||||||
@ -39,6 +38,15 @@ variable "task_meta" {
|
|||||||
description = "Meta attributes to attach to the task"
|
description = "Meta attributes to attach to the task"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "task_identity" {
|
||||||
|
description = "Task workload identity"
|
||||||
|
type = object({
|
||||||
|
env = optional(bool, false)
|
||||||
|
file = optional(bool, false)
|
||||||
|
})
|
||||||
|
default = null
|
||||||
|
}
|
||||||
|
|
||||||
variable "group_meta" {
|
variable "group_meta" {
|
||||||
type = map(string)
|
type = map(string)
|
||||||
default = {}
|
default = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user