2022-10-27 11:39:39 +02:00
|
|
|
resource "nomad_volume" "matrix-synapse" {
|
2022-09-18 18:24:43 +02:00
|
|
|
type = "csi"
|
2022-10-27 11:39:39 +02:00
|
|
|
plugin_id = "org.democratic-csi.nfs"
|
|
|
|
volume_id = "matrix-synapse"
|
|
|
|
name = "matrix-synapse"
|
|
|
|
external_id = "matrix-synapse"
|
2022-09-18 18:24:43 +02:00
|
|
|
|
|
|
|
capability {
|
|
|
|
access_mode = "single-node-writer"
|
|
|
|
attachment_mode = "file-system"
|
|
|
|
}
|
|
|
|
|
|
|
|
context = {
|
|
|
|
server = "blowhole.hosts.in.redalder.org"
|
2022-10-27 11:39:39 +02:00
|
|
|
share = "/var/nfs/matrix/synapse"
|
|
|
|
node_attach_driver = "nfs"
|
|
|
|
provisioner_driver = "node-manual"
|
2022-09-18 18:24:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
mount_options {
|
|
|
|
fs_type = "nfs"
|
2022-10-27 11:39:39 +02:00
|
|
|
mount_flags = [ "nfsvers=3", "hard", "async" ]
|
2022-09-18 18:24:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-30 01:21:24 +02:00
|
|
|
resource "nomad_volume" "matrix-postgresql" {
|
|
|
|
type = "csi"
|
|
|
|
plugin_id = "org.democratic-csi.nfs"
|
|
|
|
volume_id = "matrix-postgresql"
|
|
|
|
name = "matrix-postgresql"
|
|
|
|
external_id = "matrix-postgresql"
|
|
|
|
|
|
|
|
capability {
|
|
|
|
access_mode = "single-node-writer"
|
|
|
|
attachment_mode = "file-system"
|
|
|
|
}
|
|
|
|
|
|
|
|
context = {
|
|
|
|
server = "blowhole.hosts.in.redalder.org"
|
|
|
|
share = "/var/nfs/matrix/postgresql"
|
|
|
|
node_attach_driver = "nfs"
|
|
|
|
provisioner_driver = "node-manual"
|
|
|
|
}
|
|
|
|
|
|
|
|
mount_options {
|
|
|
|
fs_type = "nfs"
|
|
|
|
mount_flags = [ "nfsvers=3", "hard", "async" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-27 11:39:39 +02:00
|
|
|
resource "nomad_volume" "matrix-registrations" {
|
|
|
|
type = "csi"
|
|
|
|
plugin_id = "org.democratic-csi.nfs"
|
|
|
|
volume_id = "matrix-registrations"
|
|
|
|
name = "matrix-registrations"
|
|
|
|
external_id = "matrix-registrations"
|
|
|
|
|
|
|
|
capability {
|
|
|
|
access_mode = "multi-node-multi-writer"
|
|
|
|
attachment_mode = "file-system"
|
|
|
|
}
|
|
|
|
|
|
|
|
context = {
|
|
|
|
server = "blowhole.hosts.in.redalder.org"
|
|
|
|
share = "/var/nfs/matrix/registrations"
|
|
|
|
node_attach_driver = "nfs"
|
|
|
|
provisioner_driver = "node-manual"
|
|
|
|
}
|
|
|
|
|
|
|
|
mount_options {
|
|
|
|
fs_type = "nfs"
|
|
|
|
mount_flags = [ "nfsvers=3", "hard", "async" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "nomad_volume" "matrix-mautrix-facebook" {
|
|
|
|
type = "csi"
|
|
|
|
plugin_id = "org.democratic-csi.nfs"
|
|
|
|
volume_id = "matrix-mautrix-facebook"
|
|
|
|
name = "matrix-mautrix-facebook"
|
|
|
|
external_id = "matrix-mautrix-facebook"
|
|
|
|
|
|
|
|
capability {
|
|
|
|
access_mode = "single-node-writer"
|
|
|
|
attachment_mode = "file-system"
|
|
|
|
}
|
|
|
|
|
|
|
|
context = {
|
|
|
|
server = "blowhole.hosts.in.redalder.org"
|
|
|
|
share = "/var/nfs/matrix/mautrix-facebook"
|
|
|
|
node_attach_driver = "nfs"
|
|
|
|
provisioner_driver = "node-manual"
|
|
|
|
}
|
|
|
|
|
|
|
|
mount_options {
|
|
|
|
fs_type = "nfs"
|
|
|
|
mount_flags = [ "nfsvers=3", "hard", "async" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "vault_policy" "matrix-mautrix-facebook-policy" {
|
|
|
|
name = "matrix-mautrix-facebook-policy"
|
|
|
|
policy = <<EOF
|
|
|
|
path "kv/data/matrix/mautrix-facebook" {
|
|
|
|
capabilities = ["read"]
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "vault_policy" "matrix-synapse-policy" {
|
|
|
|
name = "matrix-synapse-policy"
|
|
|
|
policy = <<EOF
|
|
|
|
path "kv/data/matrix/synapse" {
|
|
|
|
capabilities = ["read"]
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
2022-09-18 18:24:43 +02:00
|
|
|
resource "nomad_job" "conduit" {
|
|
|
|
jobspec = file("${path.module}/job/conduit.hcl")
|
|
|
|
|
|
|
|
hcl2 {
|
|
|
|
enabled = true
|
|
|
|
vars = {
|
2022-10-27 11:39:39 +02:00
|
|
|
flake_ref = "${var.flake_host}?ref=${var.flake_ref}&rev=${var.flake_rev}"
|
2022-09-18 18:24:43 +02:00
|
|
|
flake_sha = var.flake_sha
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|