diff options
author | tv <tv@shackspace.de> | 2015-09-27 15:19:59 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-09-27 15:19:59 +0200 |
commit | 53f93de02f412005e33fadc50dccde1a6400abe8 (patch) | |
tree | 97eadd14882cf3159e6b2657043507f76c9b15a9 | |
parent | 2d1985e42006c121eac4bd915bee3e436ebcd314 (diff) |
krebs: no extraHosts for hosts w/o aliases
-rw-r--r-- | krebs/3modules/default.nix | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix index 5fb129747..78834d8d5 100644 --- a/krebs/3modules/default.nix +++ b/krebs/3modules/default.nix @@ -84,13 +84,16 @@ let mapAttrsToList (hostname: host: mapAttrsToList (netname: net: let - aliases = toString (unique (longs ++ shorts)); + aliases = longs ++ shorts; providers = dns.split-by-provider net.aliases cfg.dns.providers; longs = providers.hosts; - shorts = map (removeSuffix ".${cfg.search-domain}") longs; + shorts = + map (removeSuffix ".${cfg.search-domain}") + (filter (hasSuffix ".${cfg.search-domain}") + longs); in - map (addr: "${addr} ${aliases}") net.addrs - ) host.nets + map (addr: "${addr} ${toString aliases}") net.addrs + ) (filterAttrs (name: host: host.aliases != []) host.nets) ) cfg.hosts )); |