Commit 58206fa6 authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Configure log retention locally

Logs are critical for caddy-frontend, so let's configure rotate-num locally,
as changes in the stack can come unattended, and can result with loosing logs.
parent 07d2c68e
......@@ -14,7 +14,7 @@
# not need these here).
[template]
filename = instance.cfg.in
md5sum = 99f2f6d8818da4a98ca48412453c4f90
md5sum = dae3bf6daf851b5610a1a6bd83057b29
[template-common]
filename = instance-common.cfg.in
......@@ -22,7 +22,7 @@ md5sum = c801b7f9f11f0965677c22e6bbe9281b
[template-apache-frontend]
filename = instance-apache-frontend.cfg.in
md5sum = 23237969bbd9e974ac674b2052e8d67c
md5sum = 794a88ecbf81915a0400cba7cbb66242
[template-caddy-replicate]
filename = instance-apache-replicate.cfg.in
......@@ -30,7 +30,7 @@ md5sum = 19debfbc27c464f451b1eb5bb5ce3c84
[template-slave-list]
_update_hash_filename_ = templates/apache-custom-slave-list.cfg.in
md5sum = 0f37a285539c5ce7ba2d7d9d4ea0b17f
md5sum = 32069eb92bb96d8a9c4bc81f143d0e5d
[template-replicate-publish-slave-information]
_update_hash_filename_ = templates/replicate-publish-slave-information.cfg.in
......@@ -114,7 +114,7 @@ md5sum = 38792c2dceae38ab411592ec36fff6a8
[template-kedifa]
filename = instance-kedifa.cfg.in
md5sum = 9d6111a5d6bc07e708116ca331925241
md5sum = f77744e52f9d028c39f99cfbf31eadaf
[template-rsyslogd-conf]
_update_hash_filename_ = templates/rsyslogd.conf.in
......
......@@ -423,7 +423,7 @@ rendered = ${directory:bbb-ssl-dir}/frontend.crt
<= logrotate-entry-base
name = caddy
log = ${caddy-configuration:error-log} ${caddy-configuration:access-log}
rotate-num = 30
rotate-num = ${configuration:rotate-num}
# Note: Slaves do not define their own reload, as this would be repeated,
# because sharedscripts work per entry, and each slave needs its own
# olddir
......@@ -720,7 +720,7 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
<= logrotate-entry-base
name = backend-haproxy
log = ${backend-haproxy-rsyslogd-configuration:log-file}
rotate-num = 30
rotate-num = ${configuration:rotate-num}
post = kill -HUP $(cat ${backend-haproxy-rsyslogd-configuration:pid-file})
[backend-haproxy-configuration-state]
......
......@@ -230,7 +230,7 @@ config-ca-cert-file = ${kedifa-config:ca-certificate}
<= logrotate-entry-base
name = kedifa
log = ${kedifa-config:logfile}
rotate-num = 30
rotate-num = {{ instance_parameter['configuration.rotate-num'] | int }}
[kedifa]
recipe = slapos.cookbook:wrapper
......
......@@ -123,3 +123,4 @@ configuration.backend-connect-retries = 3
configuration.backend-haproxy-http-port = 21080
configuration.backend-haproxy-https-port = 21443
configuration.authenticate-to-backend = False
configuration.rotate-num = 4000
......@@ -143,6 +143,7 @@ context =
name = ${:_buildout_section_name_}
log = {{slave_parameter_dict.get('access_log')}} {{slave_parameter_dict.get('error_log')}}
backup = {{ slave_log_folder }}
rotate-num = {{ dumps('' ~ configuration['rotate-num']) }}
{#- integrate current logs inside #}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment