Move databases to a single module

This commit is contained in:
IamTheFij 2022-06-23 09:48:01 -07:00
parent a02f1a2317
commit 520d7c56b9
7 changed files with 20 additions and 10 deletions

View File

@ -36,6 +36,12 @@ resource "consul_config_entry" "mysql_intents" {
Precedence = 9 Precedence = 9
Type = "consul" Type = "consul"
}, },
{
Action = "allow"
Name = "backups"
Precedence = 9
Type = "consul"
},
] ]
}) })
} }

View File

@ -4,6 +4,9 @@ resource "nomad_job" "redis" {
} }
jobspec = file("${path.module}/redis.nomad") jobspec = file("${path.module}/redis.nomad")
# Block until deployed as there are servics dependent on this one
detach = false
} }
resource "nomad_job" "rediscommander" { resource "nomad_job" "rediscommander" {
@ -14,7 +17,6 @@ resource "nomad_job" "rediscommander" {
jobspec = file("${path.module}/rediscommander.nomad") 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" { resource "consul_config_entry" "redis_intents" {
name = "redis" name = "redis"
kind = "service-intentions" kind = "service-intentions"
@ -33,6 +35,12 @@ resource "consul_config_entry" "redis_intents" {
Precedence = 9 Precedence = 9
Type = "consul" Type = "consul"
}, },
{
Action = "allow"
Name = "authelia"
Precedence = 9
Type = "consul"
},
] ]
}) })
} }

View File

@ -1,16 +1,12 @@
module "mysql-server" { module "databases" {
source = "./mysql" source = "./databases"
}
module "redis" {
source = "./redis"
} }
module "blocky" { module "blocky" {
source = "./blocky" source = "./blocky"
base_hostname = var.base_hostname base_hostname = var.base_hostname
depends_on = [module.redis] depends_on = [module.databases]
} }
module "traefik" { module "traefik" {
@ -29,13 +25,13 @@ module "metrics" {
module "nextcloud" { module "nextcloud" {
source = "./nextcloud" source = "./nextcloud"
depends_on = [module.mysql-server] depends_on = [module.databases]
} }
module "backups" { module "backups" {
source = "./backups" source = "./backups"
depends_on = [module.mysql-server] depends_on = [module.databases]
} }
module "media" { module "media" {