Commit f7561e36 authored by Rafael Monnerat's avatar Rafael Monnerat

stack/resilience: Use logrotate stack instead repeat sections

  Simple Don't repeat yourself.
parent a08983de
......@@ -15,15 +15,15 @@
# not need these here).
[pbsready]
filename = pbsready.cfg.in
md5sum = 809f4b0b3c4976b3dae8d579f6daa615
md5sum = 2adb49f45d27cbcb7430c98c2224d76a
[pbsready-import]
filename = pbsready-import.cfg.in
md5sum = 1a31882707732f224e014c1b744df177
md5sum = a8f77b42782ec5e1fb49b5ae9891c757
[pbsready-export]
filename = pbsready-export.cfg.in
md5sum = 1b38292c42702f91f620cb99d1a88952
md5sum = bb463da1461d02d575717f1d1572bf97
[template-pull-backup]
filename = instance-pull-backup.cfg.in
......
[buildout]
extends = {{ pbsready_template_path }}
# Explicitely define extended parts from pbsready
# then add local parts
parts =
logrotate
logrotate-entry-cron
logrotate-entry-equeue
logrotate-entry-resilient
cron
cron-entry-logrotate
cron-entry-notifier-status-feed
notifier-feed-status-promise
notifier-stalled-promise
resilient-sshkeys-authority
sshd-raw-server
sshd-graceful
sshkeys-sshd
sshd-promise
resilient-sshkeys-sshd-promise
sshd-pbs-authorized-key
notifier
parts +=
notifier-exporter-promise
cron-entry-backup
[resilient-directory]
......
[buildout]
extends = ${pbsready:output}
# Explicitely define extended parts from pbsready
# then add local parts
parts =
logrotate
logrotate-entry-cron
logrotate-entry-equeue
logrotate-entry-notifier
logrotate-entry-resilient
cron
cron-entry-logrotate
cron-entry-notifier-status-feed
notifier-feed-status-promise
notifier-stalled-promise
resilient-sshkeys-authority
sshd-raw-server
sshd-graceful
sshkeys-sshd
sshd-promise
resilient-sshkeys-sshd-promise
sshd-pbs-authorized-key
notifier
parts +=
resiliency-takeover-script
resilient-web-takeover-cgi-script
resilient-web-takeover-httpd-wrapper
......
[buildout]
parts =
logrotate
parts +=
logrotate-entry-cron
logrotate-entry-equeue
logrotate-entry-notifier
logrotate-entry-resilient
cron
cron-entry-logrotate
cron-entry-notifier-status-feed
notifier-feed-status-promise
notifier-stalled-promise
resilient-sshkeys-authority
sshd-raw-server
sshd-graceful
sshkeys-sshd
sshd-promise
......@@ -20,6 +19,9 @@ parts =
notifier
extends =
${monitor2-template:rendered}
#----------------
#--
#-- Creation of all needed directories.
......@@ -62,80 +64,29 @@ monitor-resilient = $${monitor-directory:private}/resilient
#----------------
#--
#-- Deploy cron.
[cron]
recipe = slapos.cookbook:cron
dcrond-binary = ${dcron:location}/sbin/crond
cron-entries = $${directory:cron-entries}
crontabs = $${directory:crontabs}
cronstamps = $${directory:cronstamps}
catcher = $${cron-simplelogger:wrapper}
binary = $${basedirectory:services}/crond
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
wrapper = $${rootdirectory:bin}/cron_simplelogger
log = $${basedirectory:log}/crond.log
# cron and cron-simplelogger are deployed by logrotate.
#----------------
#--
#-- Deploy logrotate.
[cron-entry-logrotate]
<= cron
recipe = slapos.cookbook:cron.d
name = logrotate
frequency = 0 0 * * *
command = $${logrotate:wrapper}
[logrotate]
recipe = slapos.cookbook:logrotate
# Binaries
logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
gzip-binary = ${gzip:location}/bin/gzip
gunzip-binary = ${gzip:location}/bin/gunzip
# Directories
wrapper = $${rootdirectory:bin}/logrotate
conf = $${rootdirectory:etc}/logrotate.conf
logrotate-entries = $${directory:logrotate-entries}
backup = $${directory:logrotate-backup}
state-file = $${rootdirectory:srv}/logrotate.status
[logrotate-entry-cron]
<= logrotate
recipe =slapos.cookbook:logrotate.d
name = crond
log = $${cron-simplelogger:log}
frequency = daily
rotate-num = 30
notifempty = true
create = true
[logrotate-entry-equeue]
<= logrotate
recipe = slapos.cookbook:logrotate.d
<= logrotate-entry-base
name = equeue
log = $${equeue:log} $${sshd-server:log}
frequency = daily
rotate-num = 30
[logrotate-entry-notifier]
recipe = collective.recipe.template
mode = 600
input = inline:
$${notifier:feeds}/* {
rotate 5
weekly
nocompress
missingok
olddir $${directory:logrotate-backup}
}
output = $${logrotate:logrotate-entries}/notifier
<= logrotate-entry-base
name = notifier
log = $${notifier:feeds}/*
rotate-num = 5
frequency = weekly
nocompress = 1
[logrotate-entry-resilient]
<= logrotate
recipe = slapos.cookbook:logrotate.d
<= logrotate-entry-base
name = resilient_log
log = $${basedirectory:log}/resilient.log
frequency = weekly
......
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