Fixes for CentOS

This commit is contained in:
Tobias Herre 2023-10-29 20:13:44 +01:00
parent 9c0bb69173
commit cdeabb3a19
1 changed files with 23 additions and 1 deletions

View File

@ -4,6 +4,7 @@
bundle agent rspamd(cfg)
{
classes:
vars:
"cfgfiles" slist => {
"local.d/milter_headers.conf",
@ -30,9 +31,18 @@ vars:
"root_user" string => "root";
"root_group" string => "root";
centos::
"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 => rspamd_install_yum_repo, handle => "rspamd_yum_repo_installed";
"any" usebundle => wmde_install_packages(@(pkgs),"rspamd"),
depends_on => {"rspamd_yum_repo_installed"};
"any" usebundle => wmde_service("$(service_name)","rspamd_kept","rspamd_repaired"),
depends_on => {"rspamd_cfgs_done"};
files:
@ -58,4 +68,16 @@ reports:
}
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"
args => "-qO /etc/yum.repos.d/rspamd.repo https://rspamd.com/rpm-stable/centos-8/rspamd.repo && rpm --import https://rspamd.com/rpm-stable/gpg.key && yum update -y",
contain => wmde_cmd_useshell;
}