Creates SQL backups

This commit is contained in:
Tobias Herre 2023-10-31 17:22:50 +01:00
parent 2733ab9e7e
commit 5edbe76402
1 changed files with 34 additions and 1 deletions

View File

@ -8,6 +8,10 @@ classes:
"sympa_b"; "sympa_b";
vars: vars:
"user" string => "sympa";
"group" string => "sympa";
debian:: debian::
"lib_dir" string => "/usr/lib/sympa"; "lib_dir" string => "/usr/lib/sympa";
"var_lib_dir" string => "/var/lib/sympa"; "var_lib_dir" string => "/var/lib/sympa";
@ -126,6 +130,20 @@ commands:
depends_on => {"sympa_config_updated"}; depends_on => {"sympa_config_updated"};
# Configure Backup stuff
files:
run_backups::
"$(cfg[backup_dir])/."
create => "true";
methods:
run_backups::
"any" usebundle => create_mysql_backup_cron_job(@(cfg[db_settings]),"$(cfg[backup_dir])/sympa.sql","user_table","true");
!run_backups::
"any" usebundle => create_mysql_backup_cron_job(@(cfg[db_settings]),"$(cfg[backup_dir])/sympa.sql","user_table","false");
} }
@ -313,7 +331,16 @@ methods:
reports: reports:
} }
bundle agent sympa_create_mailname(cfg)
{
files:
debian::
"/etc/mailname"
create => "true",
perms => m("644"),
content=>"$(cfg[settings][domain])";
}
@ -324,6 +351,7 @@ vars:
"domains_idx" slist => getindices(@(cfg[domains])); "domains_idx" slist => getindices(@(cfg[domains]));
# "cfg_domains" slist => {"a","b","c"}; # "cfg_domains" slist => {"a","b","c"};
methods: methods:
"any" usebundle => sympa_create_mailname(@(cfg));
"any" usebundle => wmde_install_packages(@(sympa.pkgs),"sympa"); "any" usebundle => wmde_install_packages(@(sympa.pkgs),"sympa");
"any" usebundle => sympa_update_config(@(cfg)); "any" usebundle => sympa_update_config(@(cfg));
"any" usebundle => sympa_init_db(@(cfg)); "any" usebundle => sympa_init_db(@(cfg));
@ -553,5 +581,10 @@ methods:
reports: reports:
run_backup::
"SYMPA IS RUN BACKUP";
!run_backup::
"SYMPA DOES NOT RUN BACKUP";
} }