aboutsummaryrefslogtreecommitdiff
path: root/terraform/lhn2pi-zigbee2mqtt
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2025-02-05 18:04:47 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2025-02-05 18:04:47 +0100
commit177895ce74e47bc9327020a73b39b080a872315a (patch)
tree2ef36ddda3301e96d957e40dcb7e6fc71207457c /terraform/lhn2pi-zigbee2mqtt
parent21e47c8b92657606e81a30e1ff6734aeb7ba22bc (diff)
downloadinfra-177895ce74e47bc9327020a73b39b080a872315a.tar.gz
infra-177895ce74e47bc9327020a73b39b080a872315a.tar.bz2
infra-177895ce74e47bc9327020a73b39b080a872315a.tar.xz
infra-177895ce74e47bc9327020a73b39b080a872315a.zip
z2m: Creating tf module
Diffstat (limited to 'terraform/lhn2pi-zigbee2mqtt')
-rw-r--r--terraform/lhn2pi-zigbee2mqtt/main.tf7
-rw-r--r--terraform/lhn2pi-zigbee2mqtt/zigbee2mqtt.tf44
2 files changed, 7 insertions, 44 deletions
diff --git a/terraform/lhn2pi-zigbee2mqtt/main.tf b/terraform/lhn2pi-zigbee2mqtt/main.tf
index 1aefaaa..90527ee 100644
--- a/terraform/lhn2pi-zigbee2mqtt/main.tf
+++ b/terraform/lhn2pi-zigbee2mqtt/main.tf
@@ -31,3 +31,10 @@ locals {
module "ipam" {
source = "../ipam6"
}
+
+module "zigbee2mqtt" {
+ source = "../modules/zigbee2mqtt"
+
+ public_ip = local.public_ip
+ serial_port = "/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2688076-if00"
+}
diff --git a/terraform/lhn2pi-zigbee2mqtt/zigbee2mqtt.tf b/terraform/lhn2pi-zigbee2mqtt/zigbee2mqtt.tf
deleted file mode 100644
index 1e3e1a9..0000000
--- a/terraform/lhn2pi-zigbee2mqtt/zigbee2mqtt.tf
+++ /dev/null
@@ -1,44 +0,0 @@
-data "docker_registry_image" "zigbee2mqtt" {
- name = local.docker_image
-}
-
-resource "docker_image" "zigbee2mqtt" {
- name = data.docker_registry_image.zigbee2mqtt.name
- pull_triggers = [data.docker_registry_image.zigbee2mqtt.sha256_digest]
-}
-
-resource "docker_volume" "zigbee2mqtt" {
- name = "zigbee2mqtt"
-}
-
-resource "docker_container" "zigbee2mqtt" {
- image = docker_image.zigbee2mqtt.image_id
- name = "zigbee2mqtt"
- hostname = "zigbee2mqtt"
- # privileged = true
- must_run = true
-
- network_mode = "host"
-
- ports {
- internal = 8080
- external = 8080
- protocol = "tcp"
- ip = local.public_ip
- }
-
- volumes {
- volume_name = docker_volume.zigbee2mqtt.name
- read_only = false
- container_path = "/app/data"
- }
-
- env = [
- "TZ=Europe/Oslo",
- ]
-
- devices {
- host_path = "/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2688076-if00"
- container_path = "/dev/ttyACM0"
- }
-}