nodes: per-node default credentials seeded from the template

Add default_username/default_password as controller-only node properties
(the netmiko_device_type pattern): they are not sent to the compute,
persist with the project topology and can be updated or cleared per
node. Creating a node from a template seeds them from the template
appliance metadata, and the metadata itself is dropped there so it
never leaks into the node properties.
This commit is contained in:
YueGuobin committed 2026-08-21 21:41:42 +08:00
1 parent 300c53e6fb
commit 92d4e3d378
5 files changed
+125

No files matched your search

+8
View File
@@ -121,6 +121,14 @@ class NodeBase(BaseModel):
description="Device type for Netmiko-based automation tools, overrides the template value",
pattern=r"^[a-z0-9_]+$|^$",
)
default_username: Optional[str] = Field(
None,
description="Default username to log into the node, seeded from the template appliance metadata",
)
default_password: Optional[str] = Field(
None,
description="Default password to log into the node, seeded from the template appliance metadata",
)
aux: Optional[int] = Field(None, gt=0, le=65535, description="Auxiliary console TCP port")
aux_type: Optional[ConsoleType] = None
properties: Optional[dict] = Field(default_factory=dict, description="Properties specific to an emulator")