Initial commit

This commit is contained in:
Tobias Herre 2023-10-11 18:14:28 +02:00
parent 2b52e5e413
commit b39817b4e5
1 changed files with 83 additions and 0 deletions

83
dovecot.cf Normal file
View File

@ -0,0 +1,83 @@
#
#
#
bundle agent dovecot(cfg)
{
vars:
freebsd::
"cfg_dir" string => "/usr/local/etc/dovecot";
"dovecot_conf" string => "$(cfg_dir)/dovecot.conf";
"pkgs" slist => {
"dovecot"
};
debian::
"cfg_dir" string => "/etc/dovecot";
"dovecot_conf" string => "$(cfg_dir)/dovecot.conf";
"imap_key" string => "$(cfg_dir)/private/imap.key";
"imap_cert" string => "$(cfg_dir)/private/imap.crt";
"service_name" string => "dovecot";
"pkgs" slist => {
"dovecot-core",
"dovecot-mysql",
"dovecot-managesieved",
"dovecot-submissiond",
"dovecot-lmtpd",
"dovecot-imapd",
"dovecot-pop3d"
};
methods:
"any" usebundle => wmde_install_packages(@(pkgs),"dovecot");
"any" usebundle => wmde_service("$(service_name)","dovecot_kept","dovecot_repaired"),
depends_on => {
"dovecot_pkgs_installed",
"dovecot_imap_key_installed",
"dovecot_imap_cert_installed",
"dovecot_cfg_created"
};
services:
files:
"$(dovecot_conf)"
classes => if_repaired(dovecot_repaired),
create => "true",
template_method => "mustache",
depends_on => {"dovecot_pkgs_installed"},
handle => "dovecot_cfg_created",
edit_template => "$(sys.workdir)/inputs/$(def.wmde_libdir)/templates/dovecot/dovecot.conf.mustache";
"$(imap_cert)"
handle => "dovecot_imap_cert_installed",
classes => if_repaired(dovecot_repaired),
copy_from => local_dcp( execresult( "/usr/bin/readlink -qfn $(cfg[imap_cert])","noshell" )),
perms => mog("600","root","root");
"$(imap_key)"
handle => "dovecot_imap_key_installed",
classes => if_repaired(dovecot_repaired),
copy_from => local_dcp( execresult( "/usr/bin/readlink -qfn $(cfg[imap_key])","noshell" )),
perms => mog("600","root","root");
reports:
"IMAP_CERT: $(imap_cert)";
dovecot_kept::
"DOVECOT kept";
dovecot_repaired::
"DOVECOT repaired";
}