Introduced logrotate

This commit is contained in:
Charlie Root 2023-12-07 13:05:00 +01:00
parent 9e6956d9c0
commit 0bb0f006d1
1 changed files with 21 additions and 2 deletions

View File

@ -339,6 +339,7 @@ classes:
"delete" expression => $(site[disable]); "delete" expression => $(site[disable]);
"use_ssl" expression => $(site[ssl]); "use_ssl" expression => $(site[ssl]);
"use_certbot" expression => strcmp("certbot","$(site[ssl_cert])"); "use_certbot" expression => strcmp("certbot","$(site[ssl_cert])");
"do_logrotate" expression => $(site[logrotate]);
vars: vars:
# "email":$(apache.admin_email), # "email":$(apache.admin_email),
@ -350,7 +351,10 @@ vars:
"doc_root":"$(apache.www_dir)/$(site_param[domain])", "doc_root":"$(apache.www_dir)/$(site_param[domain])",
"doc_root_options":"Indexes FollowSymLinks", "doc_root_options":"Indexes FollowSymLinks",
"php":true, "php":true,
"php_handler":"$(apache.default_php_handler)" "php_handler":"$(apache.default_php_handler)",
"logging80":true,
"logging443":true,
"logrotate":false,
} }
'; ';
@ -420,6 +424,16 @@ methods:
"any" usebundle => restart_apache("$(site[domain])"), "any" usebundle => restart_apache("$(site[domain])"),
depends_on => {"vhost_cfg_done$(site[domain])" }; depends_on => {"vhost_cfg_done$(site[domain])" };
"any" usebundle => install_logrot;
files:
do_logrotate::
"$(logrot.dir)/$(site[domain])"
create => "true",
edit_defaults => backup("false"),
edit_template => "$(sys.workdir)/inputs/$(def.wmde_libdir)/templates/httpd-weblogrot.mustache",
template_method => "mustache";
commands: commands:
@ -432,6 +446,11 @@ commands:
reports: reports:
# "SITE: $(site[domain]): $(site[logrotate])";
# !do_logrotate::
# "LOGOROOTATE FOR $(site[domain]): FALSE";
# do_logrotate::
# "LOGOROOTATE FOR $(site[domain]): TRUE";
} }
@ -483,7 +502,7 @@ any::
}'; }';
"template_file" "template_file"
string => "$(sys.workdir)/inputs/$(def.wmde_libdir)/templates/weblogrot.mustache"; string => "$(sys.workdir)/inputs/$(def.wmde_libdir)/templates/httpd-weblogrot-matomo.mustache";
methods: methods:
"any" usebundle => install_logrot; "any" usebundle => install_logrot;