bundle to install pkgs and stuff to use rspamadm

This commit is contained in:
Tobias Herre 2023-11-03 08:55:00 +01:00
parent 204c84a896
commit 6ecad2c411
1 changed files with 25 additions and 4 deletions

View File

@ -5,13 +5,16 @@
bundle agent rspamd(cfg) bundle agent rspamd(cfg)
{ {
classes: classes:
"runpw" expression => isvariable("cfg[password]");
vars: vars:
"cfgfiles" slist => { "cfgfiles" slist => {
"local.d/milter_headers.conf", "local.d/milter_headers.conf",
# "local.d/actions.conf", # "local.d/actions.conf",
"local.d/worker-normal.inc", "local.d/worker-normal.inc",
"local.d/worker-proxy.inc", "local.d/worker-proxy.inc",
# "local.d/worker-controller.inc", "local.d/worker-controller.inc",
"local.d/redis.conf",
# "local.d/classifier-bayes.conf", # "local.d/classifier-bayes.conf",
# "local.d/worker-fuzzy.inc", # "local.d/worker-fuzzy.inc",
# "local.d/fuzzy_check.conf" # "local.d/fuzzy_check.conf"
@ -23,6 +26,7 @@ vars:
"service_name" string => "rspamd"; "service_name" string => "rspamd";
"root_user" string => "root"; "root_user" string => "root";
"root_group" string => "wheel"; "root_group" string => "wheel";
"rspamadm" string => "/usr/local/bin/rspamadm";
debian:: debian::
"pkgs" slist => {"rspamd"}; "pkgs" slist => {"rspamd"};
@ -30,6 +34,7 @@ vars:
"service_name" string => "rspamd"; "service_name" string => "rspamd";
"root_user" string => "root"; "root_user" string => "root";
"root_group" string => "root"; "root_group" string => "root";
"rspamadm" string => "/usr//bin/rspamadm";
centos:: centos::
"pkgs" slist => {"rspamd"}; "pkgs" slist => {"rspamd"};
@ -37,12 +42,17 @@ vars:
"service_name" string => "rspamd"; "service_name" string => "rspamd";
"root_user" string => "root"; "root_user" string => "root";
"root_group" string => "root"; "root_group" string => "root";
"rspamadm" string => "/usr//bin/rspamadm";
any::
"password" string => execresult("$(rspamadm) pw -p $(cfg[password])","noshell");
methods: methods:
"any" usebundle => rspamd_install_yum_repo, handle => "rspamd_yum_repo_installed"; "any" usebundle => install_rspamd_pkgs;
"any" usebundle => wmde_install_packages(@(pkgs),"rspamd"),
depends_on => {"rspamd_yum_repo_installed"};
"any" usebundle => wmde_service("$(service_name)","rspamd_kept","rspamd_repaired"), "any" usebundle => wmde_service("$(service_name)","rspamd_kept","rspamd_repaired"),
depends_on => {"rspamd_cfgs_done"}; depends_on => {"rspamd_cfgs_done"};
files: files:
@ -61,6 +71,8 @@ files:
classes => if_repaired(rspamd_repaired), classes => if_repaired(rspamd_repaired),
handle => "rspamd_cfgs_done"; handle => "rspamd_cfgs_done";
reports: reports:
# "RSPAMD: $(cfgjs)"; # "RSPAMD: $(cfgjs)";
# "RSJ: $(worker_normalx)"; # "RSJ: $(worker_normalx)";
@ -81,3 +93,12 @@ commands:
} }
bundle agent install_rspamd_pkgs
{
methods:
"any" usebundle => rspamd_install_yum_repo, handle => "rspamd_yum_repo_installed";
"any" usebundle => wmde_install_packages(@(rspamd.pkgs),"rspamd"),
depends_on => {"rspamd_yum_repo_installed"};
}