Add home-assistant

This commit is contained in:
Layla 2024-06-03 23:43:00 +02:00
parent 297e74c6f8
commit 9e355cd3a4
6 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,8 @@
version: "3"
includes:
tf:
vars:
SERVICE: "home-assistant"
ENVIRONMENT: "main"
taskfile: ../../taskfiles/Taskfile_service.dist.yml

View File

@ -0,0 +1,29 @@
resource "docker_container" "home-assistant" {
image = "homeassistant/home-assistant:${var.container_tag}"
name = var.container_name
network_mode = "host"
privileged = true
restart = "always"
mounts {
target = "/etc/localtime"
source = "/etc/localtime"
read_only = true
type = "bind"
}
mounts {
target = "/run/dbus"
source = "/run/dbus"
read_only = true
type = "bind"
}
mounts {
target = "/config"
source = "/volume1/cloud/${var.container_name}/config"
read_only = false
type = "bind"
}
}

View File

@ -0,0 +1,9 @@
variable "container_tag" {
description = "Container tag"
type = string
}
variable "container_name" {
description = "Container name"
type = string
}

View File

@ -0,0 +1,7 @@
terraform {
required_providers {
docker = {
source = "kreuzwerker/docker"
}
}
}

View File

@ -0,0 +1,7 @@
module "home-assistant" {
source = "../_common"
container_name = "home-assistant"
container_tag = "2024.5"
}

View File

@ -0,0 +1,7 @@
terraform {
required_providers {
docker = {
source = "kreuzwerker/docker"
}
}
}