diff --git a/sympa.cf b/sympa.cf index caf79a1..4d3a82d 100644 --- a/sympa.cf +++ b/sympa.cf @@ -140,6 +140,45 @@ reports: } +bundle agent sympa_create_postfix_general_maps(cfg,dest_file) +{ +vars: + "dl" slist => getindices(@(cfg[domains])); + + "cnt" string => string_mustache(" +# +# Managed by CFEngine +# +{{#dl}} +sympa@{{.}} sympa:sympa@{{.}}(dl) +listmaster@{{.}}(dl) sympa:listmaster@{{.}}(dl) +bounce@{{.}}(dl) sympa:bounce@{{.}}(dl) +abuse-feedback-report@{{.}} sympa:abuse-feedback-report@{{.}} +{{/dl}} +", +bundlestate("$(this.bundle)")); +classes: + "postfix_repaired" expression => not(fileexists("$(dest_file).db")), + scope => "namespace"; +files: + "$(dest_file)" + perms => m("644"), + create => "true", + content => "$(cnt) +", + classes => if_repaired("postfix_repaired"), + handle => "sympa_postfix_general_maps_created" ; +commands: + postfix_repaired:: + "$(postfix.postmap_cmd)" + args => "$(dest_file)", + inform => "true", + depends_on => {"sympa_postfix_general_maps_created"}; + + +reports: +} + bundle agent sympa_postfix_sql(cfg) { vars: @@ -152,14 +191,14 @@ vars: "idx" slist => getindices("file"); - "sql_dir" string => "$(postfix.cfg_dir)/sql"; - "$(idx)" string => "$(sql_dir)/$(idx).sql"; + "maps_dir" string => "$(postfix.cfg_dir)/sql"; + "$(idx)" string => "$(maps_dir)/$(idx).sql"; files: - "$(sql_dir)/." + "$(maps_dir)/." create => "true", perms => m("755"); - "$(sql_dir)/$(idx).sql" + "$(maps_dir)/$(idx).sql" create=>"true", perms=>m("644"), content=>" @@ -282,7 +321,7 @@ methods: }; # "any" usebundle => install_sympa_domain("@(cfg[domains][$(domains_idx)])"); - "any" usebundle => install_sympa_domains(@(cfg[domains2])); + "any" usebundle => install_sympa_domains(@(cfg[domains])); reports: # "IDX $(domains_idx)"; # "DOMCONF: $(cfg[$(idx)])";