docs/api: add docstrings to {run_machine_install,run_machine_deploy}

This commit is contained in:
Johannes Kirschbauer
2025-07-07 15:41:02 +02:00
parent d462ae501e
commit 655b87ad04
2 changed files with 20 additions and 0 deletions

View File

@@ -40,6 +40,16 @@ class InstallOptions:
@API.register
def run_machine_install(opts: InstallOptions, target_host: Remote) -> None:
"""Install a machine using nixos-anywhere.
Args:
opts: InstallOptions containing the machine to install, kexec option, debug mode,
no-reboot option, phases, build-on option, hardware config update, password,
identity file, and use_tor flag.
target_host: Remote object representing the target host for installation.
Raises:
ClanError: If the machine is not found in the inventory or if there are issues with
generating facts or variables.
"""
machine = opts.machine
machine.debug(f"installing {machine.name}")

View File

@@ -106,6 +106,16 @@ def upload_sources(machine: Machine, ssh: Remote) -> str:
def run_machine_deploy(
machine: Machine, target_host: Remote, build_host: Remote | None
) -> None:
"""Update an existing machine using nixos-rebuild or darwin-rebuild.
Args:
machine: The Machine instance to deploy.
target_host: Remote object representing the target host for deployment.
build_host: Optional Remote object representing the build host.
Raises:
ClanError: If the machine is not found in the inventory or if there are issues with
generating facts or variables.
"""
with ExitStack() as stack:
target_host = stack.enter_context(target_host.ssh_control_master())