diff --git a/mysql/adminer.nomad b/databases/adminer.nomad similarity index 100% rename from mysql/adminer.nomad rename to databases/adminer.nomad diff --git a/mysql/mysql.nomad b/databases/mysql.nomad similarity index 100% rename from mysql/mysql.nomad rename to databases/mysql.nomad diff --git a/mysql/mysql.tf b/databases/mysql.tf similarity index 86% rename from mysql/mysql.tf rename to databases/mysql.tf index 45aa6f9..1fe86c9 100644 --- a/mysql/mysql.tf +++ b/databases/mysql.tf @@ -36,6 +36,12 @@ resource "consul_config_entry" "mysql_intents" { Precedence = 9 Type = "consul" }, + { + Action = "allow" + Name = "backups" + Precedence = 9 + Type = "consul" + }, ] }) } diff --git a/redis/redis.nomad b/databases/redis.nomad similarity index 100% rename from redis/redis.nomad rename to databases/redis.nomad diff --git a/redis/redis.tf b/databases/redis.tf similarity index 75% rename from redis/redis.tf rename to databases/redis.tf index 80f82d0..07094f1 100644 --- a/redis/redis.tf +++ b/databases/redis.tf @@ -4,6 +4,9 @@ resource "nomad_job" "redis" { } jobspec = file("${path.module}/redis.nomad") + + # Block until deployed as there are servics dependent on this one + detach = false } resource "nomad_job" "rediscommander" { @@ -14,7 +17,6 @@ resource "nomad_job" "rediscommander" { jobspec = file("${path.module}/rediscommander.nomad") } -# NOTE: This may need to be moved to after the services are created resource "consul_config_entry" "redis_intents" { name = "redis" kind = "service-intentions" @@ -33,6 +35,12 @@ resource "consul_config_entry" "redis_intents" { Precedence = 9 Type = "consul" }, + { + Action = "allow" + Name = "authelia" + Precedence = 9 + Type = "consul" + }, ] }) } diff --git a/redis/rediscommander.nomad b/databases/rediscommander.nomad similarity index 100% rename from redis/rediscommander.nomad rename to databases/rediscommander.nomad diff --git a/services.tf b/services.tf index 2a439cb..1cb9d8b 100644 --- a/services.tf +++ b/services.tf @@ -1,16 +1,12 @@ -module "mysql-server" { - source = "./mysql" -} - -module "redis" { - source = "./redis" +module "databases" { + source = "./databases" } module "blocky" { source = "./blocky" base_hostname = var.base_hostname - depends_on = [module.redis] + depends_on = [module.databases] } module "traefik" { @@ -29,13 +25,13 @@ module "metrics" { module "nextcloud" { source = "./nextcloud" - depends_on = [module.mysql-server] + depends_on = [module.databases] } module "backups" { source = "./backups" - depends_on = [module.mysql-server] + depends_on = [module.databases] } module "media" {