diff --git a/Cargo.lock b/Cargo.lock index ed76c0ef..1287cfca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3638,6 +3638,26 @@ dependencies = [ "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]] name = "jsonpath-rust" version = "0.7.5" diff --git a/harmony/src/modules/okd/bootstrap_okd_node.rs b/harmony/src/modules/okd/bootstrap_okd_node.rs index 237f4b4a..04806dfd 100644 --- a/harmony/src/modules/okd/bootstrap_okd_node.rs +++ b/harmony/src/modules/okd/bootstrap_okd_node.rs @@ -191,22 +191,29 @@ impl OKDNodeInterpret { ); 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. - 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, + } + .to_string(); + + debug!("[{}] iPXE content template:\n{content}", self.host_role); let mac_address = node.get_mac_address(); if mac_address.is_empty() { return Err(InterpretError::new(format!(