chore(n8n): add module and job specification for Nomad deployment
All checks were successful
Terraform CI/CD / Terraform Format, Validate, Lint, Scan (push) Successful in 1m10s
Terraform CI/CD / Terraform Plan (push) Has been skipped
Terraform CI/CD / Terraform Apply (push) Successful in 45s

This commit is contained in:
Ben Martin 2025-06-02 19:11:02 +01:00
parent 2c3fd199c1
commit 28e9ead743
Signed by: ben
GPG key ID: 859A655FCD290E4A
3 changed files with 136 additions and 0 deletions

35
modules/n8n/main.tf Normal file
View file

@ -0,0 +1,35 @@
resource "nomad_job" "n8n" {
depends_on = [
nomad_csi_volume_registration.nfs_volume,
]
jobspec = file("${path.module}/jobspec.nomad.hcl")
}
data "nomad_plugin" "nfs" {
plugin_id = "nfs"
wait_for_healthy = true
}
resource "nomad_csi_volume_registration" "nfs_volume" {
depends_on = [data.nomad_plugin.nfs]
lifecycle {
prevent_destroy = true
}
plugin_id = "nfs"
name = "martinibar_prod_n8n_data"
volume_id = "martinibar_prod_n8n_data"
external_id = "martinibar_prod_n8n_data"
capability {
access_mode = "multi-node-single-writer"
attachment_mode = "file-system"
}
context = {
"server" = "martinibar.lan",
"share" = "/volume1/csi/n8n/data",
}
}