This commit is contained in:
Greyscale 2024-07-04 01:10:04 +02:00
parent 5d77766197
commit 5863de84aa
4 changed files with 25 additions and 30 deletions

View file

@ -1,33 +1,28 @@
/*provider "ssh" {
server = {
host = "california.ti"
port = 22
}
user = "techinc"
auth = {
private_key = {
content = file("~/.ssh/keys/exploding_bolts_2_rsa")
}
}
}
data "ssh_tunnel" "docker" {
connection_name = "docker_socket_tunnel_california"
remote = {
socket = "/var/run/docker.sock"
}
}
*/
provider "docker" { provider "docker" {
host = "ssh://california.ti" host = "ssh://california.ti"
registry_auth {
address = "docker.io"
username = "matthewbaggett"
password = "dckr_pat_6ytcZqdfqRXzFYe5GUh79RfH1Hw"
}
} }
provider "docker" { provider "docker" {
alias = "printi" alias = "printi"
host = "ssh://prin.ti" host = "ssh://prin.ti"
registry_auth {
address = "docker.io"
username = "matthewbaggett"
password = "dckr_pat_6ytcZqdfqRXzFYe5GUh79RfH1Hw"
}
} }
provider "docker" { provider "docker" {
alias = "unifi" alias = "unifi"
host = "ssh://unifi.ti" host = "ssh://unifi.ti"
registry_auth {
address = "docker.io"
username = "matthewbaggett"
password = "dckr_pat_6ytcZqdfqRXzFYe5GUh79RfH1Hw"
}
} }

View file

@ -19,10 +19,10 @@ variable "docker_networks" {
variable "monitored_services" { variable "monitored_services" {
type = map(list(object({ type = map(list(object({
id = string id = string
label = string label = string
endpoints = list(string) endpoints = list(string)
http_method = optional(string, null) http_method = optional(string, null)
http_status_healthy_below = optional(number, 400) http_status_healthy_below = optional(number, 400)
http_status_healthy_above = optional(number, 200) http_status_healthy_above = optional(number, 200)
}))) })))

View file

@ -14,7 +14,7 @@ terraform {
version = "~> 0.1.0" version = "~> 0.1.0"
} }
scratch = { scratch = {
source = "BrendanThompson/scratch" source = "BrendanThompson/scratch"
version = "0.4.0" version = "0.4.0"
} }
} }

View file

@ -7,9 +7,9 @@ resource "docker_service" "video_bucket" {
container_spec { container_spec {
image = "${data.docker_registry_image.video_bucket.name}@${data.docker_registry_image.video_bucket.sha256_digest}" image = "${data.docker_registry_image.video_bucket.name}@${data.docker_registry_image.video_bucket.sha256_digest}"
configs { configs {
config_id = docker_config.video_bucket_config.id config_id = docker_config.video_bucket_config.id
config_name = docker_config.video_bucket_config.name config_name = docker_config.video_bucket_config.name
file_name = "/app/.env" file_name = "/app/.env"
} }
} }
networks_advanced { networks_advanced {
@ -22,8 +22,8 @@ resource "docker_service" "video_bucket" {
} }
} }
} }
locals{ locals {
video_bucket_config = <<EOF video_bucket_config = <<EOF
S3_ENDPOINT=http://s3.california.ti S3_ENDPOINT=http://s3.california.ti
S3_BUCKET=video S3_BUCKET=video
S3_KEY=Ipi5Xh1b2UgcGiLSLLpQ S3_KEY=Ipi5Xh1b2UgcGiLSLLpQ
@ -31,7 +31,7 @@ S3_SECRET=E4xMwB44MT4tGLStJnZTwQbuDNHL1KR9M4I8taBT
EOF EOF
} }
resource "docker_config" "video_bucket_config" { resource "docker_config" "video_bucket_config" {
name = "video_bucket_config_${substr(md5(local.video_bucket_config),0,7)}" name = "video_bucket_config_${substr(md5(local.video_bucket_config), 0, 7)}"
data = base64encode(local.video_bucket_config) data = base64encode(local.video_bucket_config)
} }
module "videobucket_nginx_config" { module "videobucket_nginx_config" {