Skip to content

Commit 0b77a62

Browse files
committed
terraform/le: Refactor variables interactions
1 parent 54f88d9 commit 0b77a62

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

terraform/le/variables.tf

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
resource "nomad_variable" "omniproxy" {
2-
namespace = "mirror"
3-
path = "nomad/jobs/nginx"
4-
5-
items = {
6-
certificate = "${acme_certificate.voidlinux_org.certificate_pem}${acme_certificate.voidlinux_org.issuer_pem}"
7-
key = acme_certificate.voidlinux_org.private_key_pem
1+
resource "nomad_variable" "certs" {
2+
for_each = {
3+
"nomad/jobs/nginx" = "mirror"
4+
"nomad/jobs/nginx-control" = "infrastructure"
5+
"nomad/jobs/maddy" = "apps-restricted"
86
}
9-
}
107

11-
resource "nomad_variable" "controlproxy" {
12-
namespace = "infrastructure"
13-
path = "nomad/jobs/nginx-control"
8+
namespace = each.value
9+
path = each.key
1410

1511
items = {
1612
certificate = "${acme_certificate.voidlinux_org.certificate_pem}${acme_certificate.voidlinux_org.issuer_pem}"

0 commit comments

Comments
 (0)