engine: resources: Add a bmc resource

This resource manages bmc devices in servers or elsewhere. This also
integrates with the provisioner code.
This commit is contained in:
James Shubin
2025-01-03 18:19:31 -05:00
parent 3107dfbd08
commit e6d614f4dd
13 changed files with 1017 additions and 5 deletions

View File

@@ -560,6 +560,9 @@ class base:host($name, $config) {
$handoff_code = $config->handoff_code || ""
panic(not strings.has_prefix($handoff_code, "/"))
# This is a giant driver://user:password@host:port/whatever URL...
$bmc_uri = $config->bmc_uri || ""
# unique host key which is usually a mac address unless it's a default
$hkey = if $mac == "" {
"default"
@@ -819,6 +822,15 @@ class base:host($name, $config) {
Before => Print["ready"],
}
bmc:power "${bmc_uri}" { # TODO: Name() API is not yet stable
#password => "hunter2",
insecure_password => true, # XXX: get from uri for now
state => "on",
Meta:poll => 60, # required until BMC's support real events!
}
##$str_true = convert.format_bool(true)
##$str_false = convert.format_bool(false)
#http:flag "${name}" {