Add home-assistant
This commit is contained in:
parent
297e74c6f8
commit
9e355cd3a4
8
services/home-assistant/Taskfile.dist.yml
Normal file
8
services/home-assistant/Taskfile.dist.yml
Normal file
@ -0,0 +1,8 @@
|
||||
version: "3"
|
||||
|
||||
includes:
|
||||
tf:
|
||||
vars:
|
||||
SERVICE: "home-assistant"
|
||||
ENVIRONMENT: "main"
|
||||
taskfile: ../../taskfiles/Taskfile_service.dist.yml
|
29
services/home-assistant/_common/main.tf
Normal file
29
services/home-assistant/_common/main.tf
Normal 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"
|
||||
}
|
||||
}
|
9
services/home-assistant/_common/vars.tf
Normal file
9
services/home-assistant/_common/vars.tf
Normal file
@ -0,0 +1,9 @@
|
||||
variable "container_tag" {
|
||||
description = "Container tag"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "container_name" {
|
||||
description = "Container name"
|
||||
type = string
|
||||
}
|
7
services/home-assistant/_common/versions.tf
Normal file
7
services/home-assistant/_common/versions.tf
Normal file
@ -0,0 +1,7 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
docker = {
|
||||
source = "kreuzwerker/docker"
|
||||
}
|
||||
}
|
||||
}
|
7
services/home-assistant/main/main.tf
Normal file
7
services/home-assistant/main/main.tf
Normal file
@ -0,0 +1,7 @@
|
||||
module "home-assistant" {
|
||||
source = "../_common"
|
||||
|
||||
container_name = "home-assistant"
|
||||
container_tag = "2024.5"
|
||||
|
||||
}
|
7
services/home-assistant/main/versions.tf
Normal file
7
services/home-assistant/main/versions.tf
Normal file
@ -0,0 +1,7 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
docker = {
|
||||
source = "kreuzwerker/docker"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user