fix: use installation_device from host_config in bootstrap_okd_node #228
20
Cargo.lock
generated
20
Cargo.lock
generated
@@ -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"
|
||||||
|
|||||||
@@ -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 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, host_config) in nodes {
|
||||||
let content = BootstrapIpxeTpl {
|
let content = BootstrapIpxeTpl {
|
||||||
http_ip: &topology.http_server.get_ip().to_string(),
|
http_ip,
|
||||||
scos_path: "scos",
|
scos_path: "scos",
|
||||||
ignition_http_path: "okd_ignition_files",
|
ignition_http_path: "okd_ignition_files",
|
||||||
//TODO must be refactored to not only use /dev/sda
|
installation_device: host_config.installation_device.as_deref().ok_or_else(
|
||||||
installation_device: "/dev/sda", // This might need to be configurable per-host in the future
|
|| {
|
||||||
ignition_file_name: okd_role_properties.ignition_file(),
|
InterpretError::new(format!(
|
||||||
|
"Could not find an installation device for host {}",
|
||||||
|
node.summary()
|
||||||
|
))
|
||||||
|
},
|
||||||
|
)?,
|
||||||
|
ignition_file_name,
|
||||||
|
|
|||||||
}
|
}
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
debug!("[{}] iPXE content template:\n{content}", self.host_role);
|
debug!("[{}] iPXE content template:\n{content}", self.host_role);
|
||||||
|
|
||||||
// Create and apply an iPXE boot file for each node.
|
|
||||||
for (node, _) in nodes {
|
|
||||||
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!(
|
||||||
|
|||||||
Reference in New Issue
Block a user
shorthand this
indeed, pi http_ip aussi ...! :)