This repository has been archived on 2024-11-12. You can view files and clone it, but cannot push or open issues or pull requests.
iac/modules/vigil/configuration.tf

34 lines
1.3 KiB
Terraform
Raw Normal View History

2024-06-28 13:49:44 +00:00
locals {
services_toml = [
2024-06-28 15:53:53 +00:00
for service_group, services in var.monitored_services : templatefile("${path.module}/vigil.service.toml.tpl", {
2024-06-28 13:49:44 +00:00
service_group_id = service_group
service_group_label = service_group
services = services
})
]
vigil_toml = templatefile("${path.module}/vigil.toml.tpl", {
manager_token = random_password.token["manager"].result
reporter_token = random_password.token["worker"].result
page_title = var.page_title
page_url = var.page_url
company_name = var.company_name
icon_color = var.icon_color
icon_url = var.icon_url
logo_color = var.logo_color
logo_url = var.logo_url
website_url = var.website_url
support_url = var.support_url
custom_html = var.custom_html
services = local.services_toml
startup_notification = var.notify_on_startup
2024-07-18 15:17:26 +00:00
telegram_enable = var.notify_telegram.token == "" ? "# " : "" // Disable telegram if token is not set
telegram_bot_token = var.notify_telegram.token
telegram_chat_id = var.notify_telegram.channel
2024-06-28 13:49:44 +00:00
})
vigil_toml_checksum = md5(local.vigil_toml)
}
resource "local_file" "vigil_toml" {
filename = "${path.root}/.debug/vigil.toml"
content = local.vigil_toml
}