can set etc to a different location

This commit is contained in:
Tobias Herre 2023-11-03 08:55:37 +01:00
parent 6ecad2c411
commit b6bb057652
1 changed files with 21 additions and 13 deletions

View File

@ -284,7 +284,7 @@ reports:
}
bundle agent install_sympa_domain(domain,data)
bundle agent install_sympa_domain(domain,data,conf_dir)
{
vars:
"default_settings" data => '{
@ -297,16 +297,16 @@ vars:
"settings[domain]" string => "$(domain)";
files:
"$(sympa.conf_dir)/$(domain)/."
"$(conf_dir)/$(domain)/."
create => "true",
perms => m("755");
"$(sympa.conf_dir)/$(domain)/robot.conf"
"$(conf_dir)/$(domain)/robot.conf"
perms => m("644"),
copy_from => seed_cp("$(sys.workdir)/inputs/$(def.wmde_libdir)/templates/sympa/robot.conf"),
handle => "sympa_robot_$(domain)_ready";
"$(sympa.conf_dir)/$(domain)/robot.conf"
"$(conf_dir)/$(domain)/robot.conf"
create => "true",
perms => m("644"), #"sympa","sympa"),
edit_line => set_config_values("$(this.bundle).settings"),
@ -321,12 +321,12 @@ reports:
# "JO: $(jo)";
}
bundle agent install_sympa_domains(dl)
bundle agent install_sympa_domains(dl,conf_dir)
{
vars:
"idx" slist => getindices(@(dl));
methods:
"any" usebundle => install_sympa_domain("$(idx)",@(dl[$(idx)]));
"any" usebundle => install_sympa_domain("$(idx)",@(dl[$(idx)]),"$(conf_dir)");
reports:
}
@ -346,10 +346,18 @@ files:
bundle agent install_sympa(cfg)
{
classes:
"etc_changed" expression => isvariable("cfg[settings][etc]");
vars:
# "cfg_domains" data => @(cfg[domains]);
"domains_idx" slist => getindices(@(cfg[domains]));
# "cfg_domains" slist => {"a","b","c"};
etc_changed::
"cfg_dir" string => "$(cfg[settings][etc])";
!etc_changed::
"cfg_dir" string => "$(sympa.conf_dir)";
methods:
"any" usebundle => sympa_create_mailname(@(cfg));
"any" usebundle => wmde_install_packages(@(sympa.pkgs),"sympa");
@ -359,7 +367,8 @@ methods:
"any" usebundle => wmde_service("$(sympa.service_name)","sympa_kept","sympa_repaired"),
depends_on => {
"sympa_pkgs_installed",
"sympa_config_updated"
"sympa_config_updated",
"sympa_robots_created"
};
"any" usebundle => wmde_service("$(sympa.wwservice_name)","sympa_kept","sympa_repaired"),
depends_on => {
@ -368,11 +377,10 @@ methods:
"sympa_robots_created"
};
# "any" usebundle => install_sympa_domain("@(cfg[domains][$(domains_idx)])");
"any" usebundle => install_sympa_domains(@(cfg[domains]));
"any" usebundle => install_sympa_domains(@(cfg[domains]),"$(cfg_dir)");
reports:
# "IDX $(domains_idx)";
# "DOMCONF: $(cfg[$(idx)])";
"ETC: $(cfg_dir) - $(cfg[settings][etc])";
}