From ab97a7bffd9b369bb55220b4542de3ccddda5803 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 7 Dec 2022 12:32:21 +0100 Subject: Staging: Add CNAME target meta parameter, will be used for diplonat auto dns update --- nix/deuxfleurs.nix | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'nix/deuxfleurs.nix') diff --git a/nix/deuxfleurs.nix b/nix/deuxfleurs.nix index a83dda4..28161dc 100644 --- a/nix/deuxfleurs.nix +++ b/nix/deuxfleurs.nix @@ -90,6 +90,10 @@ in description = "Site (availability zone) on which this node is deployed"; type = types.str; }; + cname_target = mkOption { + description = "DNS CNAME target to use for services hosted in this site, for domain names that are updated by DiploNAT"; + type = types.nullOr types.str; + }; nameservers = mkOption { description = "External DNS servers to use"; type = types.listOf types.str; @@ -124,7 +128,16 @@ in }; }; - config = { + config = + let node_meta = { + "site" = cfg.site_name; + "public_ipv6" = cfg.ipv6; + } // + (if cfg.cname_target != null + then { "cname_target" = cfg.cname_target; } + else {}); + in + { # Configure admin accounts on all nodes users.users = builtins.mapAttrs (name: publicKeys: { isNormalUser = true; @@ -240,10 +253,8 @@ in // (if cfg.bootstrap then { bootstrap_expect = 3; } else {}) else {}) // { + inherit node_meta; datacenter = cfg.cluster_name; - node_meta = { - "site" = cfg.site_name; - }; ui_config = { enabled = true; }; @@ -304,10 +315,7 @@ in client = { enabled = true; network_interface = "wg0"; - meta = { - "site" = cfg.site_name; - "public_ipv6" = cfg.ipv6; - }; + meta = node_meta; }; telemetry = { publish_allocation_metrics = true; -- cgit v1.2.3