This commit is contained in:
Qubasa
2023-10-23 22:34:43 +02:00
parent 3581e0c9a8
commit c1b4fa6d55
19 changed files with 146 additions and 94 deletions

View File

@@ -1,3 +1,4 @@
import logging
import os
import shlex
import shutil
@@ -6,7 +7,6 @@ import sys
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Any
import logging
from clan_cli.nix import nix_shell
@@ -20,6 +20,7 @@ from .sops import generate_private_key
log = logging.getLogger(__name__)
def generate_host_key(flake_name: FlakeName, machine_name: str) -> None:
if has_machine(flake_name, machine_name):
return
@@ -97,7 +98,9 @@ def generate_secrets_from_nix(
) -> None:
generate_host_key(flake_name, machine_name)
errors = {}
log.debug("Generating secrets for machine %s and flake %s", machine_name, flake_name)
log.debug(
"Generating secrets for machine %s and flake %s", machine_name, flake_name
)
with TemporaryDirectory() as d:
# if any of the secrets are missing, we regenerate all connected facts/secrets
for secret_group, secret_options in secret_submodules.items():