diff --git a/modules/vigil/inputs.tf b/modules/vigil/inputs.tf index 4a963ed..08b9ef9 100644 --- a/modules/vigil/inputs.tf +++ b/modules/vigil/inputs.tf @@ -23,7 +23,10 @@ variable "monitored_services" { label = string endpoints = list(string) http_method = optional(string, null) + http_status_healthy_below = optional(number, 400) + http_status_healthy_above = optional(number, 200) }))) + } variable "page_title" { type = string diff --git a/modules/vigil/vigil.service.toml.tpl b/modules/vigil/vigil.service.toml.tpl index 832d79c..be64193 100644 --- a/modules/vigil/vigil.service.toml.tpl +++ b/modules/vigil/vigil.service.toml.tpl @@ -11,6 +11,12 @@ reveal_replica_name = true %{ if service.http_method != null ~} http_method = "${service.http_method}" %{ endif ~} +%{ if service.http_status_healthy_above != null ~} +poll_http_status_healthy_above = ${service.http_status_healthy_above} +%{ endif ~} +%{ if service.http_status_healthy_below != null ~} +poll_http_status_healthy_below = ${service.http_status_healthy_below} +%{ endif ~} replicas = [ %{ for endpoint in service.endpoints ~} "${endpoint}", diff --git a/printers.tf b/printers.tf index 7a0fdce..28f0768 100644 --- a/printers.tf +++ b/printers.tf @@ -14,20 +14,22 @@ resource "docker_volume" "ender5plus" { } resource "docker_container" "ender5plus" { - image = "${docker_image.octoprint.name}:latest" + image = "${docker_image.octoprint.name}:latest" provider = docker.printi - name = "ender5plus" + name = "ender5plus" env = [ "ENABLE_MJPG_STREAMER=false" ] - restart = "always" + network_mode = "bridge" + restart = "always" ports { internal = 80 external = 3000 } devices { - host_path = "/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A602AFFK-if00-port0" + host_path = "/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A602AFFK-if00-port0" container_path = "/dev/ttyACM0" + permissions = "rwm" } volumes { container_path = "/octoprint" diff --git a/vigil.tf b/vigil.tf index 8a5f8ff..24e5510 100644 --- a/vigil.tf +++ b/vigil.tf @@ -48,7 +48,49 @@ module "vigil" { "icmp://california.ti", "tcp://california.ti:22", ] - } + }, + { + id = "backup" + label = "Backup Server" + endpoints = [ + "icmp://backup.ti", + "tcp://backup.ti:22", + "http://backup.ti", + ] + }, + ] + "Wifi" = [ + { + id = "unifi-controller" + label = "Unifi Controller" + endpoints = [ + "icmp://unifi.ti", + "tcp://unifi.ti:22", + "http://unifi.ti", + ] + }, + { + id = "unifi-ap-mainspace" + label = "Unifi AP Mainspace" + endpoints = [ + "icmp://mainspace-ap.ti", + ] + }, + { + id = "unifi-ap-auxspace" + label = "Unifi AP Auxspace" + endpoints = [ + "icmp://auxspace-ap.ti", + ] + }, + #{ + # id = "unifi-ap-hallway" + # label = "Unifi AP Hallway" + # endpoints = [ + # "icmp://hallway-ap.ti", + # ] + #}, + ] "Printers" = [ { @@ -57,6 +99,11 @@ module "vigil" { endpoints = [ "icmp://prin.ti", "tcp://prin.ti:22", + ] + }, { + id = "ender5plus" + label = "Ender 5 Plus" + endpoints = [ "http://prin.ti:3000", ] }, { @@ -65,11 +112,11 @@ module "vigil" { endpoints = [ "icmp://v400.prin.ti", "tcp://v400.prin.ti:22", - "http://v400.prin.ti:80", + "http://v400.prin.ti", ] } ], - "Members Services" = [ + "Space Services" = [ { id = "sso" label = "SSO (auth.techinc.nl)" @@ -85,6 +132,64 @@ module "vigil" { ] http_method = "GET" }, { + id = "ansible" + label = "TechInc Ansible Server" + endpoints = [ + "icmp://ansible.ti", + "tcp://ansible.ti:22", + "http://ansible.ti" + ] + http_method = "GET" + }, + { + id = "jukebox" + label = "Indicio (Jukebox)" + endpoints = [ + "icmp://indicio.ti", + "tcp://indicio.ti:22", + ] + http_method = "GET" + }, + { + id = "shardik" + label = "Shardik (Bot)" + endpoints = [ + #"icmp://shardik.ti", # Doesn't work? + "tcp://shardik.ti:22", + "http://shardik.ti" + ] + http_method = "GET" + }, + { + id = "sip" + label = "SIP" + endpoints = [ + "icmp://sip.ti", + "http://sip.ti" + ] + http_method = "GET" + }, + { + id = "wheel" + label = "TI Wheel" + endpoints = [ + "icmp://wheel.ti", + #"http://wheel.ti" # requires basic auth + ] + http_method = "GET" + }, + { + id = "arrow" + label = "TI Arrow" + endpoints = [ + "icmp://arrow.ti", + #"http://arrow.ti" # requires basic auth + ] + http_method = "GET" + } + ], + "Members Services" = [ + { id = "s3" label = "S3 (s3.california.ti)" endpoints = [