From 9782fa1ef59a5d6fa820794247492296149287ba Mon Sep 17 00:00:00 2001 From: Guillaume Marceau Date: Mon, 4 Jul 2022 17:12:01 +0200 Subject: [PATCH 1/2] Add : repository configuration --- README.md | 5 +++-- main.tf | 5 +++++ variables.tf | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4c506d9..def0b68 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ module jenkins { | app | an application to deploy | `map(any)` | n/a | yes | | namespace | namespace where to deploy an application | `string` | n/a | yes | | repository | Helm repository | `string` | n/a | yes | +| repository\_config | repository configuration | `map(any)` | n/a | yes | | set | Value block with custom STRING values to be merged with the values yaml. |
list(object({
name = string
value = string
}))
| `null` | no | | set\_sensitive | Value block with custom sensitive values to be merged with the values yaml that won't be exposed in the plan's diff. |
list(object({
path = string
value = string
}))
| `null` | no | | values | Extra values | `list(string)` | `[]` | no | @@ -117,10 +118,10 @@ module jenkins { ``` -$ make help +$ make help hooks Commit hooks setup validate Validate with pre-commit hooks -changelog Update changelog +changelog Update changelog ``` diff --git a/main.tf b/main.tf index 7daa346..8827ed1 100644 --- a/main.tf +++ b/main.tf @@ -2,6 +2,11 @@ resource "helm_release" "this" { count = var.app["deploy"] ? 1 : 0 namespace = var.namespace repository = var.repository + repository_key_file = lookup(var.repository_config, "repository_key_file", null) + repository_cert_file = lookup(var.repository_config, "repository_cert_file", null) + repository_ca_file = lookup(var.repository_config, "repository_ca_file", null) + repository_username = lookup(var.repository_config, "repository_username", null) + repository_password = lookup(var.repository_config, "repository_password", null) name = var.app["name"] version = var.app["version"] chart = var.app["chart"] diff --git a/variables.tf b/variables.tf index 116e61e..6c42c60 100644 --- a/variables.tf +++ b/variables.tf @@ -8,6 +8,11 @@ variable "app" { type = map(any) } +variable "repository_config" { + description = "repository configuration" + type = map(any) +} + variable "values" { description = "Extra values" type = list(string) From 2227e5d11b33ecc732ba14c9e379b753c14d7adf Mon Sep 17 00:00:00 2001 From: Guillaume Marceau Date: Mon, 4 Jul 2022 17:36:44 +0200 Subject: [PATCH 2/2] fix variable default --- variables.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/variables.tf b/variables.tf index 6c42c60..11099ce 100644 --- a/variables.tf +++ b/variables.tf @@ -11,6 +11,7 @@ variable "app" { variable "repository_config" { description = "repository configuration" type = map(any) + default = {} } variable "values" {