2022-06-01 08:41:51 +02:00
|
|
|
resource "nomad_volume" "syncthing-data" {
|
|
|
|
type = "csi"
|
2022-10-27 11:38:38 +02:00
|
|
|
plugin_id = "org.democratic-csi.nfs"
|
2022-06-01 08:41:51 +02:00
|
|
|
volume_id = "syncthing-data"
|
|
|
|
name = "syncthing-data"
|
|
|
|
external_id = "syncthing-data"
|
|
|
|
|
|
|
|
capability {
|
|
|
|
access_mode = "single-node-writer"
|
|
|
|
attachment_mode = "file-system"
|
|
|
|
}
|
|
|
|
|
|
|
|
context = {
|
2022-07-30 23:27:40 +02:00
|
|
|
server = "blowhole.hosts.in.redalder.org"
|
2023-05-03 12:07:50 +02:00
|
|
|
share = "/mnt/kyle/infrastructure/syncthing/data"
|
2022-10-27 11:38:38 +02:00
|
|
|
node_attach_driver = "nfs"
|
|
|
|
provisioner_driver = "node-manual"
|
2022-06-01 08:41:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
mount_options {
|
|
|
|
fs_type = "nfs"
|
2023-05-03 12:07:50 +02:00
|
|
|
mount_flags = [ "hard", "vers=4.2", "rsize=131072", "wsize=131072", "async" ]
|
2022-06-01 08:41:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "nomad_volume" "syncthing-storage" {
|
|
|
|
type = "csi"
|
2022-10-27 11:38:38 +02:00
|
|
|
plugin_id = "org.democratic-csi.nfs"
|
2022-06-01 08:41:51 +02:00
|
|
|
volume_id = "syncthing-storage"
|
|
|
|
name = "syncthing-storage"
|
|
|
|
external_id = "syncthing-storage"
|
|
|
|
|
|
|
|
capability {
|
|
|
|
access_mode = "single-node-writer"
|
|
|
|
attachment_mode = "file-system"
|
|
|
|
}
|
|
|
|
|
|
|
|
context = {
|
2022-07-30 23:27:40 +02:00
|
|
|
server = "blowhole.hosts.in.redalder.org"
|
2023-05-03 12:07:50 +02:00
|
|
|
share = "/mnt/kyle/infrastructure/syncthing/storage"
|
2022-10-27 11:38:38 +02:00
|
|
|
node_attach_driver = "nfs"
|
|
|
|
provisioner_driver = "node-manual"
|
2022-06-01 08:41:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
mount_options {
|
|
|
|
fs_type = "nfs"
|
2023-05-03 12:07:50 +02:00
|
|
|
mount_flags = [ "hard", "vers=4.2", "rsize=131072", "wsize=131072", "async" ]
|
2022-06-01 08:41:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "nomad_volume" "syncthing-config" {
|
|
|
|
type = "csi"
|
2022-10-27 11:38:38 +02:00
|
|
|
plugin_id = "org.democratic-csi.nfs"
|
2022-06-01 08:41:51 +02:00
|
|
|
volume_id = "syncthing-config"
|
|
|
|
name = "syncthing-config"
|
|
|
|
external_id = "syncthing-config"
|
|
|
|
|
|
|
|
capability {
|
|
|
|
access_mode = "single-node-writer"
|
|
|
|
attachment_mode = "file-system"
|
|
|
|
}
|
|
|
|
|
|
|
|
context = {
|
2022-07-30 23:27:40 +02:00
|
|
|
server = "blowhole.hosts.in.redalder.org"
|
2023-05-03 12:07:50 +02:00
|
|
|
share = "/mnt/kyle/infrastructure/syncthing/config"
|
2022-10-27 11:38:38 +02:00
|
|
|
node_attach_driver = "nfs"
|
|
|
|
provisioner_driver = "node-manual"
|
2022-06-01 08:41:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
mount_options {
|
|
|
|
fs_type = "nfs"
|
2023-05-03 12:07:50 +02:00
|
|
|
mount_flags = [ "hard", "vers=4.2", "rsize=131072", "wsize=131072", "async" ]
|
2022-06-01 08:41:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "nomad_job" "syncthing" {
|
2022-07-30 23:27:40 +02:00
|
|
|
jobspec = file("${path.module}/job/syncthing.hcl")
|
2022-06-01 08:41:51 +02:00
|
|
|
|
|
|
|
hcl2 {
|
|
|
|
enabled = true
|
|
|
|
vars = {
|
2022-08-26 20:51:11 +02:00
|
|
|
flake_ref = "${var.flake_host}?rev=${var.flake_rev}&ref=${var.flake_ref}"
|
2022-06-01 08:41:51 +02:00
|
|
|
flake_sha = var.flake_sha
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|