lib/get_host: improve abstraction, turn missconfiguration into a warning

Motivation: A warning should encourage consistent usage of inventory.machines setting targetHost inside the machine should be considered a custom override

Changing the warning strings to avoid the term 'nix'/'json' both inventory and nixos machines are nix features
This commit is contained in:
Johannes Kirschbauer
2025-07-04 10:02:06 +02:00
parent 13d6db98d1
commit 52b711667e

View File

@@ -188,7 +188,7 @@ def get_host(
if host_str is None:
machine.warn(
f"'{field}' is not set in `inventory.machines.${name}.deploy.targetHost` - falling back to _slower_ nixos option: `clan.core.networking.targetHost`"
f"'{field}' is not set in `inventory.machines.${name}.deploy.targetHost` - falling back to _slower_ nixos option: `clan.core.networking.{field}`"
)
host_str = machine.select(f'config.clan.core.networking."{field}"')
source = "machine"