e9e28a5ca8
- Created model files for Qwen3.5 with different context lengths. - Added a new Ansible host variable file for CI server configuration. - Updated GPU server host variables to include Ollama models and model files. - Enhanced playbooks for Podman to manage Ollama models, including copying model files and checking existing models. - Introduced a new playbook for setting up Qwen3.6 with specific configurations. - Updated Windows SSH tasks to improve security and configuration management. - Added a Python utility to parse Ollama model names from command output. - Modified Terraform configurations to include new DNS entries and proxy settings. - Improved Nginx proxy configurations with timeout settings.
78 lines
3.2 KiB
Terraform
78 lines
3.2 KiB
Terraform
locals {
|
|
wireguard_version = "1.0.20210914-r4-ls54"
|
|
wireguard_config = try(templatefile("${path.module}/resources/wireguard/wireguard.conf.tpl", {
|
|
wireguard_private_key = var.wireguard_config.private_key
|
|
wireguard_public_key = var.wireguard_config.public_key
|
|
wireguard_pre_shared_key = var.wireguard_config.pre_shared_key
|
|
wireguard_address = var.wireguard_config.address
|
|
wireguard_dns = var.wireguard_config.dns
|
|
wireguard_allowed_ips = join(", ", var.wireguard_config.allowed_ips)
|
|
wireguard_endpoint = "${var.wireguard_config.endpoint}:${var.wireguard_config.endpoint_port}"
|
|
}), "null")
|
|
wireguard_config_checksum = nonsensitive(sha256(local.wireguard_config))
|
|
|
|
default_headers = {
|
|
"Host" : "$host",
|
|
"X-Real-IP" : "$remote_addr",
|
|
"X-Forwarded-For" : "$proxy_add_x_forwarded_for",
|
|
"X-Forwarded-Proto" : "$scheme",
|
|
"X-Forwarded-Host" : "$host",
|
|
"X-Forwarded-Port" : "$server_port",
|
|
}
|
|
nginx_config = file("${path.module}/resources/nginx/nginx.conf")
|
|
nginx_config_checksum = sha256(local.nginx_config)
|
|
|
|
services_config = {
|
|
for k, v in var.services : "${k}.conf" => coalesce(v.config, templatefile("${path.module}/resources/nginx/conf.d/default.conf.tpl", {
|
|
errors = local.error_codes
|
|
http_port = v.http_port
|
|
https_port = v.https_port
|
|
upstream = v.upstream
|
|
resolver = v.resolver
|
|
ingress = v.ingress
|
|
service_http_port = v.service_http_port
|
|
service_https_port = v.service_https_port
|
|
tls = v.tls
|
|
fqdn = length(v.fqdn) > 0 ? join(" ", v.fqdn) : k
|
|
auth = length([for l in v.locations : true if l.private]) > 0
|
|
send_timeout = v.send_timeout
|
|
read_timeout = v.read_timeout
|
|
connect_timeout = v.connect_timeout
|
|
locations = [for l in v.locations : {
|
|
path = l.path
|
|
headers = merge(l.headers, coalesce(v.default_headers, local.default_headers))
|
|
private = l.private
|
|
upstream = l.upstream
|
|
resolver = l.resolver
|
|
rewrite = l.rewrite
|
|
}]
|
|
custom_snippet = v.custom_snippet
|
|
}))
|
|
}
|
|
services_config_checksum = sha256(jsonencode(local.services_config))
|
|
|
|
streams_config = {
|
|
for k, v in var.streams : "${k}.conf" => templatefile("${path.module}/resources/nginx/streams.d/stream.conf.tpl", {
|
|
name = k
|
|
port = v.port
|
|
upstream = v.upstream
|
|
custom_snippet = v.custom_snippet
|
|
upstream_port = coalesce(v.upstream_port, v.port)
|
|
resolver = v.resolver
|
|
protocol = upper(v.protocol)
|
|
})
|
|
}
|
|
streams_config_checksum = sha256(jsonencode(local.streams_config))
|
|
|
|
auth_script = file("${path.module}/resources/auth/auth_server.py")
|
|
auth_script_checksum = sha256(local.auth_script)
|
|
|
|
error_codes = [for f in fileset("${path.module}/resources/errors", "*.html") : split(".", f)[0]]
|
|
errors_pages = {
|
|
for f in local.error_codes :
|
|
"${f}.html" => file("${path.module}/resources/errors/${f}.html")
|
|
}
|
|
errors_pages_checksum = sha256(jsonencode(local.errors_pages))
|
|
}
|
|
|