54 lines
1.1 KiB
HCL
54 lines
1.1 KiB
HCL
resource "nomad_job" "mysql-server" {
|
|
hcl2 {
|
|
enabled = true
|
|
}
|
|
|
|
jobspec = file("${path.module}/mysql.nomad")
|
|
|
|
# Block until deployed as there are servics dependent on this one
|
|
detach = false
|
|
}
|
|
|
|
resource "nomad_job" "adminer" {
|
|
hcl2 {
|
|
enabled = true
|
|
}
|
|
|
|
jobspec = file("${path.module}/adminer.nomad")
|
|
}
|
|
|
|
# NOTE: This may need to be moved to after the services are created
|
|
resource "consul_config_entry" "mysql_intents" {
|
|
name = "mysql-server"
|
|
kind = "service-intentions"
|
|
|
|
config_json = jsonencode({
|
|
Sources = [
|
|
{
|
|
Action = "allow"
|
|
Name = "adminer"
|
|
Precedence = 9
|
|
Type = "consul"
|
|
},
|
|
{
|
|
Action = "allow"
|
|
Name = "nextcloud"
|
|
Precedence = 9
|
|
Type = "consul"
|
|
},
|
|
{
|
|
Action = "allow"
|
|
Name = "backups"
|
|
Precedence = 9
|
|
Type = "consul"
|
|
},
|
|
{
|
|
Action = "allow"
|
|
Name = "grafana"
|
|
Precedence = 9
|
|
Type = "consul"
|
|
},
|
|
]
|
|
})
|
|
}
|