mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-29 03:26:14 +01:00
107 lines
2.4 KiB
Terraform
107 lines
2.4 KiB
Terraform
|
ariable "flake_ref" {
|
||
|
type = string
|
||
|
}
|
||
|
|
||
|
variable "flake_sha" {
|
||
|
type = string
|
||
|
}
|
||
|
|
||
|
resource "nomad_volume" "home-assistant_hass" {
|
||
|
# depends_on = [data.nomad_plugin.nomad-driver-containerd]
|
||
|
type = "csi"
|
||
|
plugin_id = "nfs"
|
||
|
volume_id = "home-assistant_hass"
|
||
|
name = "home-assistant_hass"
|
||
|
external_id = "home-assistant_hass"
|
||
|
|
||
|
capability {
|
||
|
access_mode = "single-node-writer"
|
||
|
attachment_mode = "file-system"
|
||
|
}
|
||
|
|
||
|
context = {
|
||
|
server = "blowhole.in.redalder.org"
|
||
|
share = "/var/nfs/home-assistant_hass"
|
||
|
}
|
||
|
|
||
|
mount_options {
|
||
|
fs_type = "nfs"
|
||
|
mount_flags = [ "nolock", "hard" ]
|
||
|
}
|
||
|
}
|
||
|
|
||
|
resource "nomad_volume" "home-assistant_zigbee2mqtt" {
|
||
|
# depends_on = [data.nomad_plugin.nomad-driver-containerd]
|
||
|
type = "csi"
|
||
|
plugin_id = "nfs"
|
||
|
volume_id = "home-assistant_zigbee2mqtt"
|
||
|
name = "home-assistant_zigbee2mqtt"
|
||
|
external_id = "home-assistant_zigbee2mqtt"
|
||
|
|
||
|
capability {
|
||
|
access_mode = "single-node-writer"
|
||
|
attachment_mode = "file-system"
|
||
|
}
|
||
|
|
||
|
context = {
|
||
|
server = "blowhole.in.redalder.org"
|
||
|
share = "/var/nfs/home-assistant_zigbee2mqtt"
|
||
|
}
|
||
|
|
||
|
mount_options {
|
||
|
fs_type = "nfs"
|
||
|
mount_flags = [ "nolock", "hard" ]
|
||
|
}
|
||
|
}
|
||
|
|
||
|
resource "nomad_volume" "home-assistant_mosquitto" {
|
||
|
# depends_on = [data.nomad_plugin.nomad-driver-containerd]
|
||
|
type = "csi"
|
||
|
plugin_id = "nfs"
|
||
|
volume_id = "home-assistant_mosquitto"
|
||
|
name = "home-assistant_mosquitto"
|
||
|
external_id = "home-assistant_mosquitto"
|
||
|
|
||
|
capability {
|
||
|
access_mode = "single-node-writer"
|
||
|
attachment_mode = "file-system"
|
||
|
}
|
||
|
|
||
|
context = {
|
||
|
server = "blowhole.in.redalder.org"
|
||
|
share = "/var/nfs/home-assistant_mosquitto"
|
||
|
}
|
||
|
|
||
|
mount_options {
|
||
|
fs_type = "nfs"
|
||
|
mount_flags = [ "nolock", "hard" ]
|
||
|
}
|
||
|
}
|
||
|
|
||
|
resource "vault_policy" "home-assistant-policy" {
|
||
|
name = "home-assistant-policy"
|
||
|
policy = file("${path.module}/home-assistant-policy.hcl")
|
||
|
}
|
||
|
|
||
|
resource "vault_policy" "zigbee2mqtt-policy" {
|
||
|
name = "zigbee2mqtt-policy"
|
||
|
policy = file("${path.module}/zigbee2mqtt-policy.hcl")
|
||
|
}
|
||
|
|
||
|
resource "vault_policy" "mosquitto-policy" {
|
||
|
name = "mosquitto-policy"
|
||
|
policy = file("${path.module}/mosquitto-policy.hcl")
|
||
|
}
|
||
|
|
||
|
resource "nomad_job" "home-assistant" {
|
||
|
jobspec = file("${path.module}/nomad.hcl")
|
||
|
|
||
|
hcl2 {
|
||
|
enabled = true
|
||
|
vars = {
|
||
|
flake_ref = var.flake_ref
|
||
|
flake_sha = var.flake_sha
|
||
|
}
|
||
|
}
|
||
|
}
|