diff --git a/ansible_playbooks/ansible_hosts.yml b/ansible_playbooks/ansible_hosts.yml index f4875b3..196e0dc 100644 --- a/ansible_playbooks/ansible_hosts.yml +++ b/ansible_playbooks/ansible_hosts.yml @@ -19,6 +19,12 @@ all: group: "100" mode: "0755" read_only: false + - name: postgres-data + path: /srv/volumes/postgres + owner: "999" + group: "999" + mode: "0755" + read_only: false - name: lldap-data path: /srv/volumes/lldap owner: "root" diff --git a/databases/main.tf b/databases/main.tf new file mode 100644 index 0000000..d0a43a4 --- /dev/null +++ b/databases/main.tf @@ -0,0 +1,48 @@ +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" "postgres-server" { + hcl2 { + enabled = true + } + + jobspec = file("${path.module}/postgres.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") +} + +resource "nomad_job" "redis" { + hcl2 { + enabled = true + } + + jobspec = file("${path.module}/redis.nomad") + + # Block until deployed as there are servics dependent on this one + detach = false +} + +resource "nomad_job" "rediscommander" { + hcl2 { + enabled = true + } + + jobspec = file("${path.module}/rediscommander.nomad") +} diff --git a/databases/mysql.nomad b/databases/mysql.nomad index 4e6a4f5..25193c3 100644 --- a/databases/mysql.nomad +++ b/databases/mysql.nomad @@ -56,7 +56,7 @@ job "mysql-server" { template { data = <