Compare commits

..

2 Commits

Author SHA1 Message Date
Tobias Herre c51019ba09 Inital commit 2023-10-11 23:59:48 +02:00
Tobias Herre 3270974a5f bundle to create vimabdmi-sql.conf, set cfg dir to 700 2023-10-11 23:58:45 +02:00
2 changed files with 33 additions and 5 deletions

View File

@ -32,10 +32,6 @@ vars:
};
methods:
"any" usebundle => wmde_install_packages(@(pkgs),"dovecot");
"any" usebundle => wmde_service("$(service_name)","dovecot_kept","dovecot_repaired"),
@ -48,11 +44,18 @@ methods:
services:
files:
"$(cfg_dir)/."
create => "true",
perms => mog("755","root","root"),
depends_on => {"dovecot_pkgs_installed"},
handle => "dovecot_cfg_dir_created";
"$(dovecot_conf)"
classes => if_repaired(dovecot_repaired),
create => "true",
perms => mog("644","root","root"),
template_method => "mustache",
depends_on => {"dovecot_pkgs_installed"},
depends_on => {"dovecot_pkgs_installed","dovecot_cfg_dir_created"},
handle => "dovecot_cfg_created",
edit_template => "$(sys.workdir)/inputs/$(def.wmde_libdir)/templates/dovecot/dovecot.conf.mustache";
@ -81,3 +84,20 @@ reports:
"DOVECOT repaired";
}
bundle agent dovecot_vimbadmin_sql(cfg)
{
vars:
"cfg_file" string => "$(sys.workdir)/data/agent/dovecot/vimbadmin-sql.comf";
files:
"$(cfg_file)"
classes => if_repaired(dovecot_repaired),
create => "true",
template_method => "mustache",
edit_template => "$(sys.workdir)/inputs/$(def.wmde_libdir)/templates/dovecot/vimbadmin-sql.conf.mustache";
}

View File

@ -0,0 +1,8 @@
default_pass_scheme = CRYPT
driver = mysql
connect = host={{vars.dovecot_vimbadmin_sql.cfg.db_host}} dbname={{vars.dovecot_vimbadmin_sql.cfg.db_name}} user={{vars.dovecot_vimbadmin_sql.cfg.db_user}} password={{vars.dovecot_vimbadmin_sql.cfg.db_pass}}
password_query = \
SELECT username AS user, password, \
homedir AS userdb_home, uid AS userdb_uid, gid AS userdb_gid \
FROM mailbox WHERE username = '%u'
iterate_query = SELECT username AS user FROM mailbox