fix: use installation_device from host_config in bootstrap_okd_node #228

Merged
stremblay merged 3 commits from fix/installation-device-for-nodes-in-byMAC into master 2026-02-05 22:38:01 +00:00
2 changed files with 40 additions and 13 deletions

20
Cargo.lock generated
View File

@@ -3638,6 +3638,26 @@ dependencies = [
"thiserror 1.0.69", "thiserror 1.0.69",
] ]
[[package]]
name = "json-prompt"
version = "0.1.0"
dependencies = [
"brocade",
"cidr",
"env_logger",
"harmony",
"harmony_cli",
"harmony_macros",
"harmony_secret",
"harmony_secret_derive",
"harmony_types",
"log",
"schemars 0.8.22",
"serde",
"tokio",
"url",
]
[[package]] [[package]]
name = "jsonpath-rust" name = "jsonpath-rust"
version = "0.7.5" version = "0.7.5"

View File

@@ -191,22 +191,29 @@ impl OKDNodeInterpret {
); );
let okd_role_properties = self.okd_role_properties(&self.host_role); let okd_role_properties = self.okd_role_properties(&self.host_role);
// The iPXE script content is the same for all control plane nodes,
// pointing to the 'master.ign' ignition file.
let content = BootstrapIpxeTpl {
http_ip: &topology.http_server.get_ip().to_string(),
scos_path: "scos",
ignition_http_path: "okd_ignition_files",
//TODO must be refactored to not only use /dev/sda
installation_device: "/dev/sda", // This might need to be configurable per-host in the future
ignition_file_name: okd_role_properties.ignition_file(),
}
.to_string();
debug!("[{}] iPXE content template:\n{content}", self.host_role); let http_ip = &topology.http_server.get_ip().to_string();
let ignition_file_name = &okd_role_properties.ignition_file();
// Create and apply an iPXE boot file for each node. // Create and apply an iPXE boot file for each node.
for (node, _) in nodes { for (node, host_config) in nodes {
let content = BootstrapIpxeTpl {
http_ip,
scos_path: "scos",
ignition_http_path: "okd_ignition_files",
installation_device: host_config.installation_device.as_deref().ok_or_else(
|| {
InterpretError::new(format!(
"Could not find an installation device for host {}",
node.summary()
))
},
)?,
ignition_file_name,

shorthand this

shorthand this

indeed, pi http_ip aussi ...! :)

indeed, pi http_ip aussi ...! :)
}
.to_string();
debug!("[{}] iPXE content template:\n{content}", self.host_role);
let mac_address = node.get_mac_address(); let mac_address = node.get_mac_address();
if mac_address.is_empty() { if mac_address.is_empty() {
return Err(InterpretError::new(format!( return Err(InterpretError::new(format!(