🏡 index : github.com/captn3m0/nebula.git

author Nemo <commits@captnemo.in> 2023-08-03 17:00:18.0 +05:30:00
committer Nemo <commits@captnemo.in> 2023-08-03 17:00:18.0 +05:30:00
commit
e18d8b11b1d169d7ea63c9883a4c39834021f577 [patch]
tree
6ae79b3e13d1f86d06496372782ebf2ee498cb1e
parent
1feaf2e4f663276b4fbe892c11a5a6d064e0e204
download
e18d8b11b1d169d7ea63c9883a4c39834021f577.tar.gz

Adds home-assistant

Trying to run https://hackaday.com/2021/07/24/esp8266-adds-wifi-logging-to-ikeas-air-quality-sensor/

Diff

 main.tf                   |  4 ++++
 home-assistant/main.tf    | 24 ++++++++++++++++++++++++
 modules/container/main.tf |  2 ++
 modules/container/vars.tf |  5 +++++
 4 files changed, 35 insertions(+)

diff --git a/main.tf b/main.tf
index f6cf3cc..47e18b6 100644
--- a/main.tf
+++ a/main.tf
@@ -91,6 +91,10 @@
  source = "./digitalocean"
}

module "home-assistant" {

  source = "./home-assistant"
}

module "mastodon" {

  source = "./mastodon"
  db-password = data.pass_password.mastodon-db-password.password
diff --git a/home-assistant/main.tf b/home-assistant/main.tf
new file mode 100644
index 0000000..9359140 100644
--- /dev/null
+++ a/home-assistant/main.tf
@@ -1,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/modules/container/main.tf b/modules/container/main.tf
index aa4c4ad..4d604e3 100644
--- a/modules/container/main.tf
+++ a/modules/container/main.tf
@@ -17,6 +17,8 @@
  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
+++ a/modules/container/vars.tf
@@ -102,6 +102,11 @@
  default     = {}
}

variable "privileged" {

  description = "  If true, the container runs in privileged mode."
  default = false
}

variable "capabilities" {

  description = "capabilities"