local tag fix
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Vivian 2023-05-22 20:09:00 +02:00
parent 92bcd2d823
commit eadc90d14d

View file

@ -24,9 +24,10 @@ let
# Add to whatever realm a host belong to its list of tags # Add to whatever realm a host belong to its list of tags
add_realm_to_tags = mapAttrs (realm: add_realm_to_tags = mapAttrs (realm:
mapAttrs (_hostname: mapAttrs (_hostname:
{ tags ? [ ], ... }@host: { type ? "lxc", tags ? [ ], ... }@host:
host // { host // {
tags = [ realm ] ++ tags; # Tags are for deployment, so don't add them to local machines
tags = tags ++ (if type == "local" then [ ] else [ realm ]);
inherit realm; inherit realm;
})); }));
@ -41,7 +42,8 @@ let
# outputs # outputs
# Helper function to build a colmena host definition # Helper function to build a colmena host definition
mkColmenaHost = { ip ? null, exposes ? null, hostname, tags, realm, type ? "lxc", ... }@host: mkColmenaHost = { ip ? null, exposes ? null, hostname, tags, realm
, type ? "lxc", ... }@host:
let let
# this makes local apply work a bit nicer # this makes local apply work a bit nicer
name = if type == "local" then hostname else "${hostname}.${realm}"; name = if type == "local" then hostname else "${hostname}.${realm}";
@ -67,6 +69,4 @@ let
hosts = add_realm_to_tags (import ./hosts); hosts = add_realm_to_tags (import ./hosts);
flat_hosts = flatten_hosts hosts; flat_hosts = flatten_hosts hosts;
nixHosts = filter_nix_hosts flat_hosts; nixHosts = filter_nix_hosts flat_hosts;
in { in { inherit base_imports mkColmenaHost hosts flat_hosts nixHosts; }
inherit base_imports mkColmenaHost hosts flat_hosts nixHosts;
}