Compare commits
1 commit
8b6c2ca462
...
e01ecb8f1b
Author | SHA1 | Date | |
---|---|---|---|
e01ecb8f1b |
1 changed files with 48 additions and 54 deletions
|
@ -6,6 +6,7 @@
|
||||||
checks =
|
checks =
|
||||||
let
|
let
|
||||||
testDomain = "webnstest.example";
|
testDomain = "webnstest.example";
|
||||||
|
dynamicZonesDir = "/var/lib/named/zones";
|
||||||
zoneFile = pkgs.writeText "${testDomain}.zoneinfo" ''
|
zoneFile = pkgs.writeText "${testDomain}.zoneinfo" ''
|
||||||
$ORIGIN .
|
$ORIGIN .
|
||||||
$TTL 60 ; 1 minute
|
$TTL 60 ; 1 minute
|
||||||
|
@ -26,14 +27,7 @@
|
||||||
nsupdate IN AAAA ::1
|
nsupdate IN AAAA ::1
|
||||||
'';
|
'';
|
||||||
|
|
||||||
webnsupdate-machine =
|
webnsupdate-machine = {
|
||||||
{ config, ... }:
|
|
||||||
let
|
|
||||||
bindCfg = config.services.bind;
|
|
||||||
bindData = bindCfg.directory;
|
|
||||||
dynamicZonesDir = "${bindData}/zones";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = [ self.nixosModules.webnsupdate ];
|
imports = [ self.nixosModules.webnsupdate ];
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
@ -77,8 +71,9 @@
|
||||||
# shellcheck disable=SC2211,SC1127
|
# shellcheck disable=SC2211,SC1127
|
||||||
rm -f ${dynamicZonesDir}/* # reset dynamic zones
|
rm -f ${dynamicZonesDir}/* # reset dynamic zones
|
||||||
|
|
||||||
mkdir -m 0755 -p ${dynamicZonesDir}
|
${pkgs.coreutils}/bin/mkdir -m 0755 -p ${dynamicZonesDir}
|
||||||
chown named ${dynamicZonesDir}
|
chown "named" ${dynamicZonesDir}
|
||||||
|
chown "named" /var/lib/named
|
||||||
|
|
||||||
# copy dynamic zone's file to the dynamic zones dir
|
# copy dynamic zone's file to the dynamic zones dir
|
||||||
cp ${zoneFile} ${dynamicZonesDir}/${testDomain}
|
cp ${zoneFile} ${dynamicZonesDir}/${testDomain}
|
||||||
|
@ -92,7 +87,6 @@
|
||||||
nodes.machine = webnsupdate-machine;
|
nodes.machine = webnsupdate-machine;
|
||||||
testScript = ''
|
testScript = ''
|
||||||
machine.start(allow_reboot=True)
|
machine.start(allow_reboot=True)
|
||||||
machine.wait_for_unit("bind.service")
|
|
||||||
machine.wait_for_unit("webnsupdate.service")
|
machine.wait_for_unit("webnsupdate.service")
|
||||||
|
|
||||||
# ensure base DNS records area available
|
# ensure base DNS records area available
|
||||||
|
|
Loading…
Add table
Reference in a new issue