aboutsummaryrefslogtreecommitdiff
path: root/terraform/unifi-controller
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2024-08-21 22:47:51 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2024-08-21 22:47:51 +0200
commit06a9c241b2462e9819fd5ca58a519f4f538a85e4 (patch)
tree094465d7588003468eb956001e0255b9756c1f41 /terraform/unifi-controller
parent204a5bb09bbb5888621edb25de2b1faad34ab781 (diff)
downloadinfra-06a9c241b2462e9819fd5ca58a519f4f538a85e4.tar.gz
infra-06a9c241b2462e9819fd5ca58a519f4f538a85e4.tar.bz2
infra-06a9c241b2462e9819fd5ca58a519f4f538a85e4.tar.xz
infra-06a9c241b2462e9819fd5ca58a519f4f538a85e4.zip
unifi
Diffstat (limited to 'terraform/unifi-controller')
-rw-r--r--terraform/unifi-controller/main.tf4
-rw-r--r--terraform/unifi-controller/mongo.tf5
-rw-r--r--terraform/unifi-controller/unifi.tf3
3 files changed, 9 insertions, 3 deletions
diff --git a/terraform/unifi-controller/main.tf b/terraform/unifi-controller/main.tf
index f5f7b0a..55c133c 100644
--- a/terraform/unifi-controller/main.tf
+++ b/terraform/unifi-controller/main.tf
@@ -28,8 +28,10 @@ provider "docker" {
locals {
domain_name = "unifi.vpn.trygvis.io"
+ public_ip = "fdb1:4242:3538:2001::ffff"
+
docker_image_controller = "lscr.io/linuxserver/unifi-controller:8.0.24-mongoless"
- docker_image_mongo = "mongo:7.0"
+ docker_image_mongo = "mongo:7.0"
mongo_database = "unifi"
mongo_username = "unifi"
diff --git a/terraform/unifi-controller/mongo.tf b/terraform/unifi-controller/mongo.tf
index 98b4e36..2b83691 100644
--- a/terraform/unifi-controller/mongo.tf
+++ b/terraform/unifi-controller/mongo.tf
@@ -24,15 +24,18 @@ resource "docker_container" "unifi-mongo" {
name = docker_network.unifi.name
}
+ network_mode = "bridge"
+
volumes {
volume_name = docker_volume.unifi-mongo.name
+ read_only = false
container_path = "/data/db"
}
}
output "mongo_init_js" {
sensitive = true
- value = <<-EOF
+ value = <<-EOF
db.getSiblingDB("${local.mongo_database}").
createUser({
user: "${local.mongo_database}",
diff --git a/terraform/unifi-controller/unifi.tf b/terraform/unifi-controller/unifi.tf
index 8e6c7d7..4b0f1c6 100644
--- a/terraform/unifi-controller/unifi.tf
+++ b/terraform/unifi-controller/unifi.tf
@@ -52,12 +52,13 @@ resource "docker_container" "unifi-controller" {
internal = ports.value["port"]
external = ports.value["port"]
protocol = ports.value["proto"]
- ip = "fdf3:aad9:a885:77dd::2"
+ ip = local.public_ip
}
}
volumes {
volume_name = docker_volume.unifi-controller.name
+ read_only = false
container_path = "/config"
}