Skip to content

Commit

Permalink
Add var metallb
Browse files Browse the repository at this point in the history
  • Loading branch information
caruccio committed Mar 9, 2023
1 parent fd24ceb commit 27d216c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion variables-modules-merge.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"$ ./make-modules variables-modules.tf"
],
"locals": {
"modules": {}
"modules": {
"metallb": {
"enabled": "${try(var.modules.metallb.enabled, var.modules_defaults.metallb.enabled)}",
"addresses": "${try(var.modules.metallb.addresses, var.modules_defaults.metallb.addresses)}"
}
}
}
}
14 changes: 12 additions & 2 deletions variables-modules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@

variable "modules_defaults" {
description = "Configure modules to install (defaults)"
type = object({})
type = object({
metallb = object({
enabled = bool
addresses = list(string)
})
})

default = {}
default = {
metallb = {
enabled = false
addresses = []
}
}
}

locals {
Expand Down

0 comments on commit 27d216c

Please sign in to comment.