diff --git a/home-assistant/main.tf b/home-assistant/main.tf new file mode 100644 index 0000000..9359140 --- /dev/null +++ b/home-assistant/main.tf @@ -0,0 +1,24 @@ +module "home-assistant" { + name = "home-assistant" + source = "../modules/container" + + image = "ghcr.io/home-assistant/home-assistant:stable" + + resource = { + memory = 1024 + memory_swap = 1024 + } + + env = [ + "TZ=Asia/Kolkata", + ] + + network_mode = "host" + + volumes = [ + { + container_path = "/config" + host_path = "/mnt/zwing/config/home-assistant" + }, + ] +} diff --git a/main.tf b/main.tf index f6cf3cc..47e18b6 100644 --- a/main.tf +++ b/main.tf @@ -91,6 +91,10 @@ module "digitalocean" { source = "./digitalocean" } +module "home-assistant" { + source = "./home-assistant" +} + module "mastodon" { source = "./mastodon" db-password = data.pass_password.mastodon-db-password.password diff --git a/modules/container/main.tf b/modules/container/main.tf index aa4c4ad..4d604e3 100644 --- a/modules/container/main.tf +++ b/modules/container/main.tf @@ -17,6 +17,8 @@ resource "docker_container" "container" { entrypoint = var.entrypoint user = var.user + privileged = var.privileged + network_mode = var.network_mode gpus = var.gpu ? "all" : "" diff --git a/modules/container/vars.tf b/modules/container/vars.tf index 86acd87..5e7ee0b 100644 --- a/modules/container/vars.tf +++ b/modules/container/vars.tf @@ -102,6 +102,11 @@ variable "volumes" { default = {} } +variable "privileged" { + description = " If true, the container runs in privileged mode." + default = false +} + variable "capabilities" { description = "capabilities"