clanService/headscale: adjust magic dns settings
This commit is contained in:
+16
-1
@@ -320,13 +320,28 @@
|
|||||||
};
|
};
|
||||||
roles.server.machines."alasia".settings = {
|
roles.server.machines."alasia".settings = {
|
||||||
public_url = "tailvpn.public.newedge.house";
|
public_url = "tailvpn.public.newedge.house";
|
||||||
base_domain = "tailnet.newedge.house";
|
|
||||||
advertise_routes = [ "10.0.10.0/24" ];
|
advertise_routes = [ "10.0.10.0/24" ];
|
||||||
|
dns = {
|
||||||
|
magic_dns = true;
|
||||||
|
base_domain = "tailvpn.newedge.house";
|
||||||
nameservers = [
|
nameservers = [
|
||||||
"10.0.10.82"
|
"10.0.10.82"
|
||||||
"1.1.1.1"
|
"1.1.1.1"
|
||||||
"8.8.8.8"
|
"8.8.8.8"
|
||||||
];
|
];
|
||||||
|
extra_records = [
|
||||||
|
{
|
||||||
|
name = "poyerp.newedge.house";
|
||||||
|
type = "A";
|
||||||
|
value = "10.0.10.1";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "glomerp.newedge.house";
|
||||||
|
type = "A";
|
||||||
|
value = "10.0.10.1";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -19,12 +19,6 @@
|
|||||||
description = "Public URL for accessing the instance";
|
description = "Public URL for accessing the instance";
|
||||||
};
|
};
|
||||||
|
|
||||||
base_domain = lib.mkOption {
|
|
||||||
type = with lib.types; str;
|
|
||||||
default = "";
|
|
||||||
description = "Defines the base domain to create the hostnames for MagicDNS in Headscale. `base_domain` must be a FQDN, without the trailing dot. The FQDN of the hosts will be `hostname.base_domain (e.g. myhost.tailnet.example.com)";
|
|
||||||
};
|
|
||||||
|
|
||||||
advertise_routes = lib.mkOption {
|
advertise_routes = lib.mkOption {
|
||||||
type = with lib.types; listOf str;
|
type = with lib.types; listOf str;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
@@ -32,6 +26,13 @@
|
|||||||
example = [ "192.168.1.0/24" ];
|
example = [ "192.168.1.0/24" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dns = {
|
||||||
|
base_domain = lib.mkOption {
|
||||||
|
type = with lib.types; str;
|
||||||
|
default = "";
|
||||||
|
description = "Defines the base domain to create the hostnames for MagicDNS in Headscale. `base_domain` must be a FQDN, without the trailing dot. The FQDN of the hosts will be `hostname.base_domain (e.g. myhost.tailnet.example.com)";
|
||||||
|
};
|
||||||
|
|
||||||
nameservers = lib.mkOption {
|
nameservers = lib.mkOption {
|
||||||
type = with lib.types; listOf str;
|
type = with lib.types; listOf str;
|
||||||
default = [
|
default = [
|
||||||
@@ -41,6 +42,42 @@
|
|||||||
description = "List of nameservers to pass to Tailscale clients";
|
description = "List of nameservers to pass to Tailscale clients";
|
||||||
example = [ "10.0.10.1" ];
|
example = [ "10.0.10.1" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
magic_dns = lib.mkOption {
|
||||||
|
type = with lib.types; bool;
|
||||||
|
default = true;
|
||||||
|
description = "Whether to enable MagicDNS";
|
||||||
|
};
|
||||||
|
|
||||||
|
extra_records = lib.mkOption {
|
||||||
|
type =
|
||||||
|
with lib.types;
|
||||||
|
nullOr (
|
||||||
|
listOf (submodule {
|
||||||
|
options = {
|
||||||
|
name = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "DNS record name.";
|
||||||
|
example = "grafana.tailnet.example.com";
|
||||||
|
};
|
||||||
|
type = lib.mkOption {
|
||||||
|
type = lib.types.enum [
|
||||||
|
"A"
|
||||||
|
"AAAA"
|
||||||
|
];
|
||||||
|
description = "DNS record type.";
|
||||||
|
example = "A";
|
||||||
|
};
|
||||||
|
value = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "DNS record value (IP address).";
|
||||||
|
example = "100.64.0.3";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -170,10 +207,11 @@
|
|||||||
settings.server_url = "https://${settings.public_url}";
|
settings.server_url = "https://${settings.public_url}";
|
||||||
|
|
||||||
settings.dns = {
|
settings.dns = {
|
||||||
base_domain = settings.base_domain;
|
base_domain = settings.dns.base_domain;
|
||||||
override_local_dns = true;
|
override_local_dns = true;
|
||||||
nameservers.global = settings.nameservers;
|
nameservers.global = settings.dns.nameservers;
|
||||||
magic_dns = false;
|
magic_dns = settings.dns.magic_dns;
|
||||||
|
extra_records = settings.dns.extra_records;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user