wmdeit-cf-wmdelib/rspamd.cf

62 lines
1.5 KiB
CFEngine3

#
#
#
bundle agent rspamd(cfg)
{
vars:
"cfgfiles" slist => {
"local.d/milter_headers.conf",
# "local.d/actions.conf",
"local.d/worker-normal.inc",
"local.d/worker-proxy.inc",
# "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";
methods:
"any" usebundle => wmde_install_packages(@(pkgs),"rspamd");
"any" usebundle => wmde_service("$(service_name)","rspamd_kept","rspamd_repaired"),
depends_on => {"rspamd_cfgs_done"};
files:
"$(cfg_dir)/."
perms => uperm("$(root_user)","$(root_group)","755"),
depends_on => { "rspamd_pkgs_installed" },
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",
perms => m("644"),
template_data => bundlestate("$(this.bundle)"),
depends_on => { "rspamd_pkgs_installed","rspamd_cfg_dir_created" },
classes => if_repaired(rspamd_repaired),
handle => "rspamd_cfgs_done";
reports:
# "RSPAMD: $(cfgjs)";
# "RSJ: $(worker_normalx)";
}