All checks were successful
Run Check Script / check (pull_request) Successful in 1m11s
With this work, no need to initialize a full HAClusterTopology to run opnsense scores. Also added an example showing how to use it and perform basic operations. Made a video out of it, might publish it at some point!
24 lines
732 B
Rust
24 lines
732 B
Rust
use async_trait::async_trait;
|
|
use log::info;
|
|
|
|
use crate::{
|
|
infra::opnsense::OPNSenseFirewall,
|
|
topology::{PreparationError, PreparationOutcome, Topology},
|
|
};
|
|
|
|
#[async_trait]
|
|
impl Topology for OPNSenseFirewall {
|
|
async fn ensure_ready(&self) -> Result<PreparationOutcome, PreparationError> {
|
|
// FIXME we should be initializing the opnsense config here instead of
|
|
// OPNSenseFirewall::new as this causes the config to be loaded too early in
|
|
// harmony initialization process
|
|
let details = "OPNSenseFirewall topology is ready".to_string();
|
|
info!("{}", details);
|
|
Ok(PreparationOutcome::Success { details })
|
|
}
|
|
|
|
fn name(&self) -> &str {
|
|
"OPNSenseFirewall"
|
|
}
|
|
}
|