diff --git a/contexts/_template/blueprint.jsonnet b/contexts/_template/blueprint.jsonnet index 2f3a64e65..e9fe967f8 100644 --- a/contexts/_template/blueprint.jsonnet +++ b/contexts/_template/blueprint.jsonnet @@ -70,11 +70,6 @@ local concat(arrays) = std.foldl(function(x, y) x + y, arrays, []); { path: "gitops/flux", destroy: false, - values: if rawProvider == "local" then { - git_username: "local", - git_password: "local", - webhook_token: "abcdef123456", - } else {}, }, ], kustomize: diff --git a/contexts/_template/terraform/gitops/flux.jsonnet b/contexts/_template/terraform/gitops/flux.jsonnet new file mode 100644 index 000000000..816a0b033 --- /dev/null +++ b/contexts/_template/terraform/gitops/flux.jsonnet @@ -0,0 +1,13 @@ +local context = std.extVar("context"); +local hlp = std.extVar("helpers"); + +local gitUsername = hlp.getString(context, "git.livereload.username", null); +local gitPassword = hlp.getString(context, "git.livereload.password", null); +local webhook_token = if hlp.has(context, "git.livereload") then "abcdef123456" else null; + +local result = {}; + +result + + (if gitUsername != null then { git_username: gitUsername } else {}) + + (if gitPassword != null then { git_password: gitPassword } else {}) + + (if webhook_token != null then { webhook_token: webhook_token } else {})