work on a configmap to store these infos for django
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 53s

This commit is contained in:
2025-06-18 23:36:38 +01:00
parent 04aab9b16e
commit b7a0e73665
3 changed files with 30 additions and 49 deletions
+22 -49
View File
@@ -18,57 +18,35 @@ variable "nginx_sites" {
}))
}
/*
resource "local_file" "nginx" {
# for_each = var.nginx_sites
for_each = { for key, value in var.nginx_sites : key => value if value.enabled == true }
content = templatefile("nginx_config.tftpl", {
name_site = each.key
name_service = each.value.service
proxy_cache = each.value.proxy_cache
extra-value = each.value.extra-value
extra-value-location = each.value.extra-value-location
http2_bool = each.value.http2_bool
proxy_pass_https = each.value.proxy_pass_https
authentication_required = each.value.authentication_required
redirect_to_https_bool = each.value.redirect_to_https_bool
listen_port_80_bool = each.value.listen_port_80_bool
})
filename = "../conf.d/${each.key}.tryton.geeraert.eu.conf"
locals {
template = templatefile("websites_terraform.json.tftpl", {
map_of_params = var.nginx_sites
})
}
resource "local_file" "nginx" {
content = templatefile("websites_terraform.json.tftpl", {
map_of_params = var.nginx_sites })
filename = "/tmp/test.tryton.geeraert.eu.conf"
file_permission = "0600"
provisioner "local-exec" {
# command = "kubectl exec -it deploy/reverse-proxy -n reverse-proxy -- nginx -s reload"
command = "kubectl get pods -n reverse-proxy -o name | xargs -I{} kubectl exec -n reverse-proxy {} -- nginx -s reload"
quiet = true
}
resource "kubernetes_config_map" "websites_configmap" {
metadata {
name = "sites-terraform"
namespace = "django-python"
}
data = {
"websites.json" = templatefile("websites_terraform.json.tftpl", {
map_of_params = var.nginx_sites })
}
}
*/
#resource "kubernetes_config_map" "automatic-configmap" {
# metadata {
# name = "sites-terraform"
# namespace = "reverse-proxy"
# }
# for_each = { for key, value in var.nginx_sites : key => value if value.enabled == true }
# dynamic "data" {
# for_each = each.value.enabled == true ? [""] : []
# # for_each = { for key, value in var.nginx_sites : key => value if value.enabled == true }
# content {
# key = (templatefile("nginx_config.tftpl", {
# name_site = each.key
# name_service = each.value.service
# proxy_cache = each.value.proxy_cache
# extra-value = each.value.extra-value
# http2_bool = each.value.http2_bool
# proxy_pass_https = each.value.proxy_pass_https
# authentication_required = each.value.authentication_required
# }))
# }
# }
#}
resource "kubernetes_config_map" "automatic-configmap" {
metadata {
@@ -95,11 +73,6 @@ resource "kubernetes_config_map" "automatic-configmap" {
}) if value.enabled == true
}
# provisioner "local-exec" {
# command = "kubectl get pods -n reverse-proxy -o name | xargs -I{} kubectl delete -n reverse-proxy {}"
# quiet = true
# }
}