ssl is optional now

This commit is contained in:
Tobias Herre 2023-10-31 17:25:32 +01:00
parent 7d3d409c55
commit 30300d06d9
1 changed files with 51 additions and 28 deletions

View File

@ -4,6 +4,8 @@
bundle agent dovecot(cfg) bundle agent dovecot(cfg)
{ {
classes:
"use_ssl" expression => strcmp("$(cfg[ssl])","true");
vars: vars:
freebsd:: freebsd::
"cfg_dir" string => "/usr/local/etc/dovecot"; "cfg_dir" string => "/usr/local/etc/dovecot";
@ -49,13 +51,8 @@ vars:
"submission_cert" string => "$(cfg_dir)/private/submission.crt"; "submission_cert" string => "$(cfg_dir)/private/submission.crt";
"service_name" string => "dovecot"; "service_name" string => "dovecot";
use_ssl::
"service_deps" slist => {
methods:
"any" usebundle => wmde_install_packages(@(pkgs),"dovecot");
"any" usebundle => wmde_service("$(service_name)","dovecot_kept","dovecot_repaired"),
depends_on => {
"dovecot_pkgs_installed", "dovecot_pkgs_installed",
"dovecot_cfg_created", "dovecot_cfg_created",
"dovecot_imap_key_installed", "dovecot_imap_key_installed",
@ -63,7 +60,19 @@ methods:
"dovecot_submission_key_installed", "dovecot_submission_key_installed",
"dovecot_submission_cert_installed", "dovecot_submission_cert_installed",
}; };
services: !use_ssl::
"service_deps" slist => {
"dovecot_pkgs_installed",
"dovecot_cfg_created",
};
methods:
"any" usebundle => wmde_install_packages(@(pkgs),"dovecot");
"any" usebundle => wmde_service("$(service_name)","dovecot_kept","dovecot_repaired"),
depends_on => @(service_deps);
files: files:
"$(cfg_dir)/." "$(cfg_dir)/."
@ -81,6 +90,8 @@ files:
handle => "dovecot_cfg_created", handle => "dovecot_cfg_created",
edit_template => "$(sys.workdir)/inputs/$(def.wmde_libdir)/templates/dovecot/dovecot.conf.mustache"; edit_template => "$(sys.workdir)/inputs/$(def.wmde_libdir)/templates/dovecot/dovecot.conf.mustache";
use_ssl::
"$(imap_cert)" "$(imap_cert)"
handle => "dovecot_imap_cert_installed", handle => "dovecot_imap_cert_installed",
classes => if_repaired(dovecot_repaired), classes => if_repaired(dovecot_repaired),
@ -109,6 +120,11 @@ files:
reports: reports:
use_ssl::
"USE_SSL: TRUE";
!use_ssl::
"USE_SSL: FALSE";
# "IMAP_CERT: $(imap_cert)"; # "IMAP_CERT: $(imap_cert)";
# #
# dovecot_kept:: # dovecot_kept::
@ -135,3 +151,10 @@ files:
} }
bundle agent install_dovecot_pkgs
{
methods:
"any" usebundle => wmde_install_packages(@(dovecot.pkgs),"dovecot");
}