diff options
Diffstat (limited to 'terraform-ci-infra/1n_nmd/nginx')
-rw-r--r-- | terraform-ci-infra/1n_nmd/nginx/conf/nomad/nginx.hcl | 9 | ||||
-rw-r--r-- | terraform-ci-infra/1n_nmd/nginx/main.tf | 6 | ||||
-rw-r--r-- | terraform-ci-infra/1n_nmd/nginx/variables.tf | 12 |
3 files changed, 25 insertions, 2 deletions
diff --git a/terraform-ci-infra/1n_nmd/nginx/conf/nomad/nginx.hcl b/terraform-ci-infra/1n_nmd/nginx/conf/nomad/nginx.hcl index 9cb5f8ef45..3c4761c567 100644 --- a/terraform-ci-infra/1n_nmd/nginx/conf/nomad/nginx.hcl +++ b/terraform-ci-infra/1n_nmd/nginx/conf/nomad/nginx.hcl @@ -87,6 +87,15 @@ job "${job_name}" { # to 1. count = 1 + # https://www.nomadproject.io/docs/job-specification/volume + %{ if use_host_volume } + volume "prod-volume1-nginx" { + type = "host" + read_only = false + source = "${host_volume}" + } + %{ endif } + # The restart stanza configures a tasks's behavior on task failure. Restarts # happen on the client that is running the task. restart { diff --git a/terraform-ci-infra/1n_nmd/nginx/main.tf b/terraform-ci-infra/1n_nmd/nginx/main.tf index 96696922ff..025fcb6b8b 100644 --- a/terraform-ci-infra/1n_nmd/nginx/main.tf +++ b/terraform-ci-infra/1n_nmd/nginx/main.tf @@ -5,8 +5,10 @@ locals { data "template_file" "nomad_job_nginx" { template = file("${path.module}/conf/nomad/nginx.hcl") vars = { - job_name = var.nginx_job_name - datacenters = local.datacenters + job_name = var.nginx_job_name + datacenters = local.datacenters + use_host_volume = var.nginx_use_host_volume + host_volume = var.nomad_host_volume } } diff --git a/terraform-ci-infra/1n_nmd/nginx/variables.tf b/terraform-ci-infra/1n_nmd/nginx/variables.tf index 1a1e45f89f..0262014049 100644 --- a/terraform-ci-infra/1n_nmd/nginx/variables.tf +++ b/terraform-ci-infra/1n_nmd/nginx/variables.tf @@ -5,9 +5,21 @@ variable "nomad_datacenters" { default = [ "dc1" ] } +variable "nomad_host_volume" { + description = "Nomad Host Volume" + type = string + default = "persistence" +} + # Nginx variable "nginx_job_name" { description = "Nginx job name" type = string default = "nginx" +} + +variable "nginx_use_host_volume" { + description = "Use Nomad host volume feature" + type = bool + default = false }
\ No newline at end of file |