feat: Add pxe example and new data files structure

This commit is contained in:
2025-08-20 22:00:56 -04:00
parent 27c51e0ec5
commit e956772593
6 changed files with 118 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
mod topology;
use harmony::{
modules::{dhcp::DhcpScore, tftp::TftpScore},
score::Score,
topology::{HAClusterTopology, Url},
};
use crate::topology::{get_inventory, get_topology};
#[tokio::main]
async fn main() {
let inventory = get_inventory();
let topology = get_topology().await;
let gateway_ip = topology.router.get_gateway();
let scores: Vec<Box<dyn Score<HAClusterTopology>>> = vec![
Box::new(DhcpScore {
host_binding: vec![],
next_server: Some(topology.router.get_gateway()),
boot_filename: None,
filename: Some("undionly.kpxe".to_string()),
filename64: Some("ipxe.efi".to_string()),
filenameipxe: Some(format!("http://{gateway_ip}:8080/boot.ipxe").to_string()),
}),
Box::new(TftpScore {
files_to_serve: Url::LocalFolder("./data/pxe/okd/tftpboot/".to_string()),
}),
];
harmony_cli::run(inventory, topology, scores, None).await.unwrap();
}