diff --git a/harmony-rs/opnsense-config/src/config/config.rs b/harmony-rs/opnsense-config/src/config/config.rs index cea652b..bef244b 100644 --- a/harmony-rs/opnsense-config/src/config/config.rs +++ b/harmony-rs/opnsense-config/src/config/config.rs @@ -68,7 +68,7 @@ impl Config { pub async fn install_package(&mut self, package_name: &str) -> Result<(), Error> { info!("Installing opnsense package {package_name}"); let output = self.shell - .exec(&format!("pkg install -y {package_name}")) + .exec(&format!("/usr/local/opnsense/scripts/firmware/install.sh {package_name}")) .await?; info!("Installation output {output}"); self.reload_config().await?; diff --git a/harmony-rs/opnsense-config/src/modules/load_balancer.rs b/harmony-rs/opnsense-config/src/modules/load_balancer.rs index 72b161a..d30dcdb 100644 --- a/harmony-rs/opnsense-config/src/modules/load_balancer.rs +++ b/harmony-rs/opnsense-config/src/modules/load_balancer.rs @@ -61,6 +61,11 @@ impl<'a> LoadBalancerConfig<'a> { self.opnsense_shell.exec("configctl haproxy stop").await?; self.opnsense_shell.exec("configctl template reload OPNsense/HAProxy").await?; self.opnsense_shell.exec("configctl template reload OPNsense/Syslog").await?; + + // This script copies the staging config to production config. I am not 100% sure it is + // required in the context + self.opnsense_shell.exec("/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh deploy").await?; + self.opnsense_shell.exec("configctl haproxy configtest").await?; self.opnsense_shell.exec("configctl haproxy start").await?; Ok(())