fix case when secrets are regenerated during update/install

This commit is contained in:
Jörg Thalheim
2024-04-12 14:38:21 +02:00
parent 573a462aee
commit b3522b73aa
3 changed files with 101 additions and 89 deletions

View File

@@ -96,6 +96,11 @@ def deploy_nixos(hosts: HostGroup) -> None:
ssh_arg = f"-p {h.port}" if h.port else ""
env = os.environ.copy()
env["NIX_SSHOPTS"] = ssh_arg
machine: Machine = h.meta["machine"]
generate_facts(machine)
upload_secrets(machine)
path = upload_sources(".", target)
if h.host_key_check != HostKeyCheck.STRICT:
@@ -105,11 +110,6 @@ def deploy_nixos(hosts: HostGroup) -> None:
ssh_arg += " -i " + h.key if h.key else ""
machine: Machine = h.meta["machine"]
generate_facts(machine)
upload_secrets(machine)
extra_args = h.meta.get("extra_args", [])
cmd = [
"nixos-rebuild",