forked from NationTech/harmony
wip: FQM topology with OKDHaCluster, not satisfied yet with the cluster topology data structure
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
pub mod inventory;
|
||||
pub mod topology;
|
||||
pub fn add(left: usize, right: usize) -> usize {
|
||||
left + right
|
||||
}
|
||||
|
||||
@@ -18,5 +18,5 @@ async fn main() {
|
||||
let score = OPNSenseDhcpScore::new(InventoryFilter::new(vec![]));
|
||||
let result = maestro.interpret(score).await.unwrap();
|
||||
info!("{result}");
|
||||
}).await;
|
||||
}).await.unwrap();
|
||||
}
|
||||
|
||||
86
harmony-rs/fqm/src/topology.rs
Normal file
86
harmony-rs/fqm/src/topology.rs
Normal file
@@ -0,0 +1,86 @@
|
||||
use std::net::{IpAddr, Ipv4Addr};
|
||||
|
||||
use harmony::{
|
||||
hardware::*,
|
||||
topology::{ClusterMember, HAClusterTopology, IpAddress, OPNSenseManagement},
|
||||
};
|
||||
|
||||
pub fn fqm_topology() -> HAClusterTopology {
|
||||
HAClusterTopology {
|
||||
firewall: vec![ClusterMember {
|
||||
management: Box::new(OPNSenseManagement::new(
|
||||
"user".to_string(),
|
||||
"password".to_string(),
|
||||
)),
|
||||
host: Host {
|
||||
category: HostCategory::Firewall,
|
||||
network: vec![
|
||||
NetworkInterface::new(
|
||||
"igb0".to_string(),
|
||||
"00:90:7f:df:2c:1f".to_string(),
|
||||
1_000_000_000,
|
||||
true,
|
||||
),
|
||||
NetworkInterface::new(
|
||||
"igb1".to_string(),
|
||||
"00:90:7f:df:2c:20".to_string(),
|
||||
1_000_000_000,
|
||||
true,
|
||||
),
|
||||
NetworkInterface::new(
|
||||
"igb2".to_string(),
|
||||
"00:90:7f:df:2c:21".to_string(),
|
||||
1_000_000_000,
|
||||
true,
|
||||
),
|
||||
NetworkInterface::new(
|
||||
"igb3".to_string(),
|
||||
"00:90:7f:df:2c:22".to_string(),
|
||||
1_000_000_000,
|
||||
true,
|
||||
),
|
||||
NetworkInterface::new(
|
||||
"igb4".to_string(),
|
||||
"00:90:7f:df:2c:23".to_string(),
|
||||
1_000_000_000,
|
||||
true,
|
||||
),
|
||||
NetworkInterface::new(
|
||||
"igb5".to_string(),
|
||||
"00:90:7f:df:2c:24".to_string(),
|
||||
1_000_000_000,
|
||||
true,
|
||||
),
|
||||
NetworkInterface::new(
|
||||
"igb6".to_string(),
|
||||
"00:90:7f:df:2c:25".to_string(),
|
||||
1_000_000_000,
|
||||
true,
|
||||
),
|
||||
NetworkInterface::new(
|
||||
"igb7".to_string(),
|
||||
"00:90:7f:df:2c:26".to_string(),
|
||||
1_000_000_000,
|
||||
true,
|
||||
),
|
||||
],
|
||||
storage: vec![Storage::new(
|
||||
StorageConnectionType::Sata6g,
|
||||
StorageKind::SSD,
|
||||
240_000_000_000,
|
||||
"TODO".to_string(),
|
||||
)],
|
||||
labels: vec![Label::new(
|
||||
"operatingSystem".to_string(),
|
||||
"opnsense".to_string(),
|
||||
)],
|
||||
},
|
||||
}],
|
||||
control_plane: todo!(),
|
||||
workers: todo!(),
|
||||
ceph_hosts: todo!(),
|
||||
switch: todo!(),
|
||||
gateway: IpAddress::V4(Ipv4Addr::new(10, 10, 8, 1)),
|
||||
load_balancer: IpAddress::V4(Ipv4Addr::new(10, 10, 8, 1)),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user