wip: PXE setup for ipxe and okd files in progress
Some checks failed
Run Check Script / check (pull_request) Failing after 36s

This commit is contained in:
2025-08-21 17:28:17 -04:00
parent e956772593
commit da6610c625
24 changed files with 1242 additions and 209 deletions

View File

@@ -125,9 +125,10 @@ async fn main() {
harmony::modules::okd::load_balancer::OKDLoadBalancerScore::new(&topology);
let tftp_score = TftpScore::new(Url::LocalFolder("./data/watchguard/tftpboot".to_string()));
let http_score = StaticFilesHttpScore::new(Url::LocalFolder(
"./data/watchguard/pxe-http-files".to_string(),
));
let http_score = StaticFilesHttpScore {
folder_to_serve: Some(Url::LocalFolder("./data/watchguard/pxe-http-files".to_string())),
files: vec![],
};
let ipxe_score = IpxeScore::new();
harmony_tui::run(

View File

@@ -1,7 +1,8 @@
mod topology;
use harmony::{
modules::{dhcp::DhcpScore, tftp::TftpScore},
data::{FileContent, FilePath},
modules::{dhcp::DhcpScore, http::StaticFilesHttpScore, tftp::TftpScore},
score::Score,
topology::{HAClusterTopology, Url},
};
@@ -14,6 +15,7 @@ async fn main() {
let topology = get_topology().await;
let gateway_ip = topology.router.get_gateway();
// TODO this should be a single IPXEScore instead of having the user do this step by step
let scores: Vec<Box<dyn Score<HAClusterTopology>>> = vec![
Box::new(DhcpScore {
host_binding: vec![],
@@ -26,7 +28,23 @@ async fn main() {
Box::new(TftpScore {
files_to_serve: Url::LocalFolder("./data/pxe/okd/tftpboot/".to_string()),
}),
Box::new(StaticFilesHttpScore {
folder_to_serve: None,
files: vec![FileContent {
path: FilePath::Relative("boot.ipxe".to_string()),
content: format!(
"#!ipxe
set base-url http://{gateway_ip}:8080
set hostfile ${{base-url}}/byMAC/01-${{mac:hexhyp}}.ipxe
chain ${{hostfile}} || chain ${{base-url}}/default.ipxe"
),
}],
}),
];
harmony_cli::run(inventory, topology, scores, None).await.unwrap();
harmony_cli::run(inventory, topology, scores, None)
.await
.unwrap();
}

View File

@@ -80,9 +80,12 @@ async fn main() {
let load_balancer_score = OKDLoadBalancerScore::new(&topology);
let tftp_score = TftpScore::new(Url::LocalFolder("./data/watchguard/tftpboot".to_string()));
let http_score = StaticFilesHttpScore::new(Url::LocalFolder(
"./data/watchguard/pxe-http-files".to_string(),
));
let http_score = StaticFilesHttpScore {
folder_to_serve: Some(Url::LocalFolder(
"./data/watchguard/pxe-http-files".to_string(),
)),
files: vec![],
};
harmony_tui::run(
inventory,