wmdeit-cf-wmdelib/rspamd.cf

84 lines
2.2 KiB
CFEngine3
Raw Normal View History

2023-10-06 16:50:42 +00:00
#
#
#
bundle agent rspamd(cfg)
{
2023-10-29 19:13:44 +00:00
classes:
2023-10-06 16:50:42 +00:00
vars:
"cfgfiles" slist => {
"local.d/milter_headers.conf",
# "local.d/actions.conf",
"local.d/worker-normal.inc",
2023-10-16 07:24:52 +00:00
"local.d/worker-proxy.inc",
2023-10-06 16:50:42 +00:00
# "local.d/worker-controller.inc",
# "local.d/classifier-bayes.conf",
# "local.d/worker-fuzzy.inc",
# "local.d/fuzzy_check.conf"
};
freebsd::
"pkgs" slist => {"rspamd"};
"cfg_dir" string => "/usr/local/etc/rspamd";
"service_name" string => "rspamd";
"root_user" string => "root";
"root_group" string => "wheel";
debian::
"pkgs" slist => {"rspamd"};
"cfg_dir" string => "/etc/rspamd";
"service_name" string => "rspamd";
"root_user" string => "root";
"root_group" string => "root";
2023-10-16 07:24:52 +00:00
2023-10-29 19:13:44 +00:00
centos::
"pkgs" slist => {"rspamd"};
"cfg_dir" string => "/etc/rspamd";
"service_name" string => "rspamd";
"root_user" string => "root";
"root_group" string => "root";
2023-10-16 07:24:52 +00:00
methods:
2023-10-29 19:13:44 +00:00
"any" usebundle => rspamd_install_yum_repo, handle => "rspamd_yum_repo_installed";
"any" usebundle => wmde_install_packages(@(pkgs),"rspamd"),
depends_on => {"rspamd_yum_repo_installed"};
2023-10-16 07:24:52 +00:00
"any" usebundle => wmde_service("$(service_name)","rspamd_kept","rspamd_repaired"),
depends_on => {"rspamd_cfgs_done"};
2023-10-06 16:50:42 +00:00
files:
"$(cfg_dir)/."
perms => uperm("$(root_user)","$(root_group)","755"),
2023-10-16 07:24:52 +00:00
depends_on => { "rspamd_pkgs_installed" },
2023-10-06 16:50:42 +00:00
handle => "rspamd_cfg_dir_created";
"$(cfg_dir)/$(cfgfiles)"
create => "true",
edit_template => "$(sys.workdir)/inputs/$(def.wmde_libdir)/templates/rspamd/$(cfgfiles).mustache",
template_method => "mustache",
2023-10-16 07:24:52 +00:00
perms => m("644"),
2023-10-06 16:50:42 +00:00
template_data => bundlestate("$(this.bundle)"),
2023-10-16 07:24:52 +00:00
depends_on => { "rspamd_pkgs_installed","rspamd_cfg_dir_created" },
classes => if_repaired(rspamd_repaired),
2023-10-06 16:50:42 +00:00
handle => "rspamd_cfgs_done";
reports:
# "RSPAMD: $(cfgjs)";
# "RSJ: $(worker_normalx)";
}
2023-10-29 19:13:44 +00:00
bundle agent rspamd_install_yum_repo
{
classes:
centos::
"install_yum_repo" expression => not(fileexists("/etc/yum.repos.d/rspamd.repo"));
commands:
install_yum_repo::
"wget"
2023-10-31 16:22:18 +00:00
args => "-qO /etc/yum.repos.d/rspamd.repo https://rspamd.com/rpm-stable/centos-$(sys.os_version_major)/rspamd.repo && rpm --import https://rspamd.com/rpm-stable/gpg.key && yum update -y",
2023-10-29 19:13:44 +00:00
contain => wmde_cmd_useshell;
2023-10-06 16:50:42 +00:00
2023-10-29 19:13:44 +00:00
}