Route OPNsense library and custom jobs through the standard order composer

This commit is contained in:
2026-11-20 08:15:07 +01:00
parent 8a1ea58d86
commit 1f3cd5ea0c
5 changed files with 12 additions and 58 deletions
+6 -1
View File
@@ -493,6 +493,10 @@ impl Action {
privileged_script_profile:Some(PrivilegedScriptProfile::FullMaintenanceV1), ..}
if interpreter=="posix_sh") && self.validate()
}
pub fn opnsense_service_script(&self) -> bool {
matches!(self, Self::RunScript {interpreter,windows_execution_profile:None,privileged_script_profile:None,..}
if interpreter=="posix_sh") && self.validate()
}
/// Shared plan/revalidation/start gate. Passive inventory never implies job support.
pub fn available_for(&self, identity: &str, capabilities: &[String]) -> bool {
@@ -506,7 +510,8 @@ impl Action {
let has = |cap: &str| capabilities.iter().any(|c| c == cap);
if has("opnsense.base/1") {
return has("run_script") && has("rmm.sync.v1") && !has("windows.base/1") && !has("linux.base/1")
&& ((identity=="agent_service" && has("opnsense.uname/1") && self.opnsense_kernel_probe())
&& ((identity=="agent_service" && ((has("opnsense.uname/1") && self.opnsense_kernel_probe())
|| (has("opnsense.posix/1") && self.opnsense_service_script())))
|| (identity=="root" && has("opnsense.root.posix/1") && has(FULL_MAINTENANCE_CAPABILITY)
&& has("helper.root.v1") && has("root:run_script") && self.opnsense_root_script()));
}