ansble-terraform-jsonnet/config/config.libsonnet

31 lines
1.6 KiB
Plaintext

local credentials = import "../credentials.libsonnet";
local terraform = import "../lib/terraform.libsonnet";
credentials + {
local hashIp(name) = std.substr(std.md5(name), 0, 4) + ":" + std.substr(std.md5(name), 4, 4),
local serverMeta(name, instance) = {
name: name,
publicSubdomain: name + ".infra",
internalSubdomain: name + ".i.infra",
publicDomain: self.publicSubdomain + "." + $.infraDomain,
internalDomain: self.internalSubdomain + $.infraDomain,
wireguardIp: $.ipSubnet + ":" + hashIp(name),
instance: instance + { name: name }
},
infraDomain: "m5w.de",
# needs to be /96
ipSubnet: "fdc2:d459:3f8a:84a3:coffe:coffe",
defaultTTL: 3600,
defaultZoneTTL: 86400,
sshKeys: {
martin: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCzXsN8jgzF51mQS5gfo4H7QKNhDKDEyXZSGen83MYw9GyIMi+AdH1fuhnYBlN2fTlHjs88otZkBMhVzE5lbkutz07j+ZpF6AdUvxqesqkXa2hdXFBRRwnG7u0Pxbi7vhr7uUWMa1WzJYynwmYBLL0yNEK6dI1qJcpwaK6v8UOZymiSJh04Sqd1LfEKd7R3BdzRCqkeKab1351OmJSswN+HRsAsDbdOIDBXpUMomvYAxJud4Wv90NcXfYikI7lhaAILBPTSUQqgTFFHhjfw9pe6Uhxb5URVS5ENjYVDyD2Lo1daZwy+sSYvA1LKZLQVEBKyx1o6SLLsuYqOuOIxiy8UEQ9vLHBdYQ+Ca0m2TruPtxEIu67WQFMBjMXcja4p516UkiuFqr0sQftI0HvVIZHS95DTK2BygkOy9Aok/fQ4IBeraN9EjIRkAB5Hn0z8vxBQMf9ZKUisMbN8nk22YpGte1RD9BFS9Swm7IE1c55QD30S6tD5z0lMUcU+ol3rOIh/013hNj9ZLsYxOtGJtIX3Xc+tIbUgXKou1sjPGQx4M2t9RRZTJ8L4l2DYw4joNoFXGiwFW586DBMw6wb9YeikA+Nuy0RFY8ytgBD5Qdh7IbF7+aA8f0ZkGHkmf/VLM1UkO5XXh3bNlz03IPcav091mAAlu/OHCdOhN54V9vE1FQ== cardno:4268913'
},
servers: [
serverMeta("dust2", terraform.HcloudInstance {
server_type: "cx11"
})
]
}