Add Unifi and Cloudflare provider configurations and examples
Deploy Infrastructure / plan (push) Failing after 19s
Deploy Infrastructure / apply (push) Has been skipped
Security Audit / Infrastructure Scan (IaC) (push) Successful in 17s
Ansible Setup / ansible (push) Successful in 2m13s
Security Audit / Docker Image Scan (docker.io/gotenberg/gotenberg:8) (push) Failing after 2m54s
Security Audit / Docker Image Scan (docker.io/library/postgres:15) (push) Failing after 31s
Security Audit / Docker Image Scan (docker.io/library/redis:7) (push) Failing after 17s
Security Audit / Docker Image Scan (ghcr.io/icereed/paperless-gpt:latest) (push) Failing after 17s
Security Audit / Docker Image Scan (ghcr.io/paperless-ngx/paperless-ngx:latest) (push) Failing after 2m47s
Security Audit / Docker Image Scan (shenxn/protonmail-bridge:latest) (push) Successful in 17s
Security Audit / Docker Image Scan (docker.io/apache/tika:latest) (push) Failing after 9m48s

This commit is contained in:
2026-02-02 21:54:10 +01:00
parent ba0baa3c10
commit 3aa23aa2b3
7 changed files with 172 additions and 0 deletions
+4
View File
@@ -4,6 +4,10 @@
"/^tofu plan -no-color$/": {
"approve": true,
"matchCommandLine": true
},
"/^cd /home/krenner/homelab/opentofu && tofu plan$/": {
"approve": true,
"matchCommandLine": true
}
}
}
+46
View File
@@ -1,6 +1,29 @@
# This file is maintained automatically by "tofu init".
# Manual edits may be lost in future updates.
provider "registry.opentofu.org/cloudflare/cloudflare" {
version = "4.52.5"
constraints = "~> 4.0"
hashes = [
"h1:18bXaaOSq8MWKuMxo/4y7EB7/i7G90y5QsKHZRmkoDo=",
"zh:1a3400cb38863b2585968d1876706bcfc67a148e1318a1d325c6c7704adc999b",
"zh:4c5062cb9e9da1676f06ae92b8370186d98976cc4c7030d3cd76df12af54282a",
"zh:52110f493b5f0587ef77a1cfd1a67001fd4c617b14c6502d732ab47352bdc2f7",
"zh:5aa536f9eaeb43823aaf2aa80e7d39b25ef2b383405ed034aa16a28b446a9238",
"zh:5cc39459a1c6be8a918f17054e4fbba573825ed5597dcada588fe99614d98a5b",
"zh:629ae6a7ba298815131da826474d199312d21cec53a4d5ded4fa56a692e6f072",
"zh:719cc7c75dc1d3eb30c22ff5102a017996d9788b948078c7e1c5b3446aeca661",
"zh:8698635a3ca04383c1e93b21d6963346bdae54d27177a48e4b1435b7f731731c",
"zh:890df766e9b839623b1f0437355032a3c006226a6c200cd911e15ee1a9014e9f",
"zh:8a9993f1dcadf1dd6ca43b23348abe374605d29945a2fafc07fb3457644e6a54",
"zh:b1b9a1e6bcc24d5863a664a411d2dc906373ae7a2399d2d65548ce7377057852",
"zh:b270184cdeec277218e84b94cb136fead753da717f9b9dc378e51907f3f00bb0",
"zh:dff2bc10071210181726ce270f954995fe42c696e61e2e8f874021fed02521e5",
"zh:e8e87b40b6a87dc097b0fdc20d3f725cec0d82abc9cc3755c1f89f8f6e8b0036",
"zh:ee964a6573d399a5dd22ce328fb38ca1207797a02248f14b2e4913ee390e7803",
]
}
provider "registry.opentofu.org/hashicorp/aws" {
version = "5.100.0"
constraints = "~> 5.0"
@@ -40,3 +63,26 @@ provider "registry.opentofu.org/telmate/proxmox" {
"zh:f415cc6f735a3971faae6ac24034afdb9ee83373ef8de19a9631c187d5adc7db",
]
}
provider "registry.opentofu.org/ubiquiti-community/unifi" {
version = "0.41.12"
constraints = "0.41.12"
hashes = [
"h1:B/jK5VsotLdJleBuYY/iILvKYwPaBa7Aih7e104ab7k=",
"zh:22b6b00886b041265e9e96669a3ed8f359e7a9e47a002a01837663e85ff41384",
"zh:2e57eb66b6f46bef0ba00db8fac4ad5cd5dd774ec30bf43d939fc45256813f1b",
"zh:376e528b0ddc73a33d34c23e2342a51042d2ae92d328352fcce667fe1ee3c5d2",
"zh:3ca2c82450c3e57158cb161927510886465006041cbf28a52dfb9bc5d7ba6150",
"zh:471342ef42eb8ac77503417ba3831bdbc6f863201d2b8e790452ded2e0a1fed5",
"zh:6a79496aafbdec844b6a065d1f79c7649e21927e4651689b8711e6437af26b7e",
"zh:6c2897e6989f2a4d08c5f6a815482ac1c91f8a5516bca3e653338792711695d7",
"zh:890df766e9b839623b1f0437355032a3c006226a6c200cd911e15ee1a9014e9f",
"zh:9bfed50e2bc4c7a917e83a341afc08e63984ddcaf609b5c7343d208b7ac0944c",
"zh:a31b7a19168ac76699de93e41d7dcebc3b7783533a0048a8250bfbd00c7df35b",
"zh:dfa3a63ba6e72c7fb5c17bcdf31f4010a2eabccf631860441775a6eb36624579",
"zh:eb25b6fe1ec1e336d09f18197548da1077cc2d16502152eba06e7182852c32f3",
"zh:eb66e34fe0ccec95f616abeec2e32a460d0b1fbdef845baf7e89a1bbc3628905",
"zh:f4a37bc2abfc50f6c7af23b462d8abf52a0f7647881128adfd6fafd28af7c38a",
"zh:ff9290e387aced795df9c2dab7e774c8f3e2b9e3c499747ebad63607f30ae5f3",
]
}
+43
View File
@@ -0,0 +1,43 @@
# Example: Manage a Cloudflare Tunnel
# 1. Create the Tunnel Resource
# resource "cloudflare_tunnel" "homelab_tunnel" {
# account_id = var.cloudflare_account_id
# name = "homelab-tunnel"
# secret = base64sha256(random_password.tunnel_secret.result)
# }
#
# 2. Generate a random secret for the tunnel
# resource "random_password" "tunnel_secret" {
# length = 32
# special = false
# }
#
# 3. Configure the Tunnel (Ingress Rules)
# resource "cloudflare_tunnel_config" "homelab_config" {
# account_id = var.cloudflare_account_id
# tunnel_id = cloudflare_tunnel.homelab_tunnel.id
#
# config {
# ingress_rule {
# hostname = "gitea.renner.uno"
# service = "http://10.2.40.114:3000"
# origin_request {
# connect_timeout = "1m"
# }
# }
#
# # Catch-all rule (Required)
# ingress_rule {
# service = "http_status:404"
# }
# }
# }
#
# 4. Create DNS Records pointing to the Tunnel
# resource "cloudflare_record" "gitea" {
# zone_id = "your_zone_id_here"
# name = "gitea"
# value = "${cloudflare_tunnel.homelab_tunnel.id}.cfargotunnel.com"
# type = "CNAME"
# proxied = true
# }
+11
View File
@@ -19,6 +19,10 @@ terraform {
source = "hashicorp/aws"
version = "~> 5.0"
}
unifi = {
source = "ubiquiti-community/unifi"
version = "0.41.12"
}
}
}
@@ -42,3 +46,10 @@ provider "aws" {
}
}
provider "unifi" {
username = var.unifi_username
password = var.unifi_password
api_url = var.unifi_api_url
allow_insecure = var.unifi_insecure
}
+34
View File
@@ -0,0 +1,34 @@
# Example: Manage a Network
# resource "unifi_network" "example_vlan" {
# name = "terraform-test"
# site = "default"
# purpose = "corporate"
# subnet = "10.10.10.1/24"
# vlan_id = 10
# dhcp_start = "10.10.10.100"
# dhcp_stop = "10.10.10.200"
# dhcp_enabled = true
# }
# Example: Manage a WLAN
# resource "unifi_wlan" "example_wifi" {
# name = "Terraform WiFi"
# site = "default"
# passphrase = "supersecretpassword"
# security = "wpapsk"
# network_id = unifi_network.example_vlan.id
# }
resource "unifi_dns_record" "s3_vip" {
name = "s3.renner.uno"
record_type = "A"
value = "10.2.40.101"
enabled = true
}
resource "unifi_dns_record" "caddy_vip" {
name = "ingress.renner.uno"
record_type = "A"
value = "10.2.45.100"
enabled = true
}
+11
View File
@@ -0,0 +1,11 @@
variable "cloudflare_api_token" {
type = string
description = "The Cloudflare API Token"
sensitive = true
}
variable "cloudflare_account_id" {
type = string
description = "The Cloudflare Account ID"
sensitive = true
}
+23
View File
@@ -0,0 +1,23 @@
variable "unifi_api_url" {
type = string
description = "The URL of the Unifi Controller (e.g., https://192.168.1.1)"
default = "https://192.168.1.1"
}
variable "unifi_username" {
type = string
description = "The username for the Unifi Controller"
sensitive = true
}
variable "unifi_password" {
type = string
description = "The password for the Unifi Controller"
sensitive = true
}
variable "unifi_insecure" {
type = bool
description = "Whether to skip TLS verification for the Unifi Controller"
default = true
}