2022-07-25 17:37:32 +00:00
|
|
|
module "databases" {
|
|
|
|
source = "./databases"
|
|
|
|
}
|
|
|
|
|
|
|
|
module "blocky" {
|
|
|
|
source = "./blocky"
|
|
|
|
|
|
|
|
base_hostname = var.base_hostname
|
|
|
|
depends_on = [module.databases]
|
|
|
|
}
|
|
|
|
|
|
|
|
module "traefik" {
|
|
|
|
source = "./traefik"
|
|
|
|
|
2022-07-28 22:10:39 +00:00
|
|
|
base_hostname = var.base_hostname
|
2022-07-25 17:37:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module "metrics" {
|
|
|
|
source = "./metrics"
|
|
|
|
|
|
|
|
consul_address = var.consul_address
|
|
|
|
}
|
2022-07-25 17:46:16 +00:00
|
|
|
|
|
|
|
module "loki" {
|
|
|
|
source = "./levant"
|
|
|
|
|
|
|
|
template_path = "service.nomad"
|
|
|
|
variables = {
|
|
|
|
name = "loki"
|
|
|
|
image = "grafana/loki:2.2.1"
|
|
|
|
service_port = 3100
|
|
|
|
ingress = true
|
|
|
|
sticky_disk = true
|
2022-07-25 22:49:29 +00:00
|
|
|
healthcheck = "/ready"
|
2022-07-25 17:46:16 +00:00
|
|
|
templates = jsonencode([
|
|
|
|
{
|
|
|
|
data = file("./loki-config.yml")
|
|
|
|
dest = "/etc/loki/local-config.yaml"
|
|
|
|
}
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-25 22:49:29 +00:00
|
|
|
resource "consul_config_entry" "loki_intent" {
|
|
|
|
name = "loki"
|
|
|
|
kind = "service-intentions"
|
|
|
|
|
|
|
|
config_json = jsonencode({
|
|
|
|
Sources = [
|
|
|
|
{
|
|
|
|
Action = "allow"
|
|
|
|
Name = "grafana"
|
|
|
|
Precedence = 9
|
|
|
|
Type = "consul"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Action = "allow"
|
|
|
|
Name = "promtail"
|
|
|
|
Precedence = 9
|
|
|
|
Type = "consul"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Action = "allow"
|
|
|
|
Name = "syslogng-promtail"
|
|
|
|
Precedence = 9
|
|
|
|
Type = "consul"
|
|
|
|
},
|
|
|
|
]
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2022-07-25 17:46:16 +00:00
|
|
|
resource "nomad_job" "syslog-ng" {
|
|
|
|
jobspec = file("${path.module}/syslogng.nomad")
|
|
|
|
}
|
2022-07-25 22:49:29 +00:00
|
|
|
|
2022-07-27 21:45:08 +00:00
|
|
|
resource "nomad_job" "ddclient" {
|
|
|
|
jobspec = file("${path.module}/ddclient.nomad")
|
|
|
|
}
|
|
|
|
|
2022-07-27 22:57:28 +00:00
|
|
|
resource "nomad_job" "lldap" {
|
|
|
|
jobspec = file("${path.module}/lldap.nomad")
|
|
|
|
}
|
|
|
|
|
2022-07-25 22:49:29 +00:00
|
|
|
resource "consul_config_entry" "syslogng_promtail_intent" {
|
|
|
|
name = "syslogng-promtail"
|
|
|
|
kind = "service-intentions"
|
|
|
|
|
|
|
|
config_json = jsonencode({
|
|
|
|
Sources = [
|
|
|
|
{
|
|
|
|
Action = "allow"
|
|
|
|
Name = "syslogng"
|
|
|
|
Precedence = 9
|
|
|
|
Type = "consul"
|
|
|
|
},
|
|
|
|
]
|
|
|
|
})
|
|
|
|
}
|
2022-07-25 22:54:23 +00:00
|
|
|
|
|
|
|
resource "consul_config_entry" "global_access" {
|
|
|
|
name = "*"
|
|
|
|
kind = "service-intentions"
|
|
|
|
|
|
|
|
config_json = jsonencode({
|
|
|
|
Sources = [
|
|
|
|
{
|
|
|
|
Action = "allow"
|
|
|
|
Name = "traefik"
|
|
|
|
Precedence = 6
|
|
|
|
Type = "consul"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Action = "deny"
|
|
|
|
Name = "*"
|
|
|
|
Precedence = 5
|
|
|
|
Type = "consul"
|
|
|
|
},
|
|
|
|
]
|
|
|
|
})
|
|
|
|
}
|