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 @@ ...@@ -15,15 +15,15 @@
# not need these here). # not need these here).
[pbsready] [pbsready]
filename = pbsready.cfg.in filename = pbsready.cfg.in
md5sum = 809f4b0b3c4976b3dae8d579f6daa615 md5sum = 2adb49f45d27cbcb7430c98c2224d76a
[pbsready-import] [pbsready-import]
filename = pbsready-import.cfg.in filename = pbsready-import.cfg.in
md5sum = 1a31882707732f224e014c1b744df177 md5sum = a8f77b42782ec5e1fb49b5ae9891c757
[pbsready-export] [pbsready-export]
filename = pbsready-export.cfg.in filename = pbsready-export.cfg.in
md5sum = 1b38292c42702f91f620cb99d1a88952 md5sum = bb463da1461d02d575717f1d1572bf97
[template-pull-backup] [template-pull-backup]
filename = instance-pull-backup.cfg.in filename = instance-pull-backup.cfg.in
......
[buildout] [buildout]
extends = {{ pbsready_template_path }} extends = {{ pbsready_template_path }}
# Explicitely define extended parts from pbsready parts +=
# 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
notifier-exporter-promise notifier-exporter-promise
cron-entry-backup cron-entry-backup
[resilient-directory] [resilient-directory]
......
[buildout] [buildout]
extends = ${pbsready:output} extends = ${pbsready:output}
# Explicitely define extended parts from pbsready parts +=
# 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
resiliency-takeover-script resiliency-takeover-script
resilient-web-takeover-cgi-script resilient-web-takeover-cgi-script
resilient-web-takeover-httpd-wrapper resilient-web-takeover-httpd-wrapper
......
[buildout] [buildout]
parts = parts +=
logrotate
logrotate-entry-cron logrotate-entry-cron
logrotate-entry-equeue logrotate-entry-equeue
logrotate-entry-notifier logrotate-entry-notifier
logrotate-entry-resilient logrotate-entry-resilient
cron cron
cron-entry-logrotate
cron-entry-notifier-status-feed cron-entry-notifier-status-feed
notifier-feed-status-promise notifier-feed-status-promise
notifier-stalled-promise notifier-stalled-promise
resilient-sshkeys-authority resilient-sshkeys-authority
sshd-raw-server
sshd-graceful sshd-graceful
sshkeys-sshd sshkeys-sshd
sshd-promise sshd-promise
...@@ -20,6 +19,9 @@ parts = ...@@ -20,6 +19,9 @@ parts =
notifier notifier
extends =
${monitor2-template:rendered}
#---------------- #----------------
#-- #--
#-- Creation of all needed directories. #-- Creation of all needed directories.
...@@ -62,80 +64,29 @@ monitor-resilient = $${monitor-directory:private}/resilient ...@@ -62,80 +64,29 @@ monitor-resilient = $${monitor-directory:private}/resilient
#---------------- #----------------
#-- #--
#-- Deploy cron. #-- Deploy cron.
# cron and cron-simplelogger are deployed by logrotate.
[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
#---------------- #----------------
#-- #--
#-- Deploy 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-entry-equeue]
<= logrotate <= logrotate-entry-base
recipe = slapos.cookbook:logrotate.d
name = equeue name = equeue
log = $${equeue:log} $${sshd-server:log} log = $${equeue:log} $${sshd-server:log}
frequency = daily frequency = daily
rotate-num = 30 rotate-num = 30
[logrotate-entry-notifier] [logrotate-entry-notifier]
recipe = collective.recipe.template <= logrotate-entry-base
mode = 600 name = notifier
input = inline: log = $${notifier:feeds}/*
$${notifier:feeds}/* { rotate-num = 5
rotate 5 frequency = weekly
weekly nocompress = 1
nocompress
missingok
olddir $${directory:logrotate-backup}
}
output = $${logrotate:logrotate-entries}/notifier
[logrotate-entry-resilient] [logrotate-entry-resilient]
<= logrotate <= logrotate-entry-base
recipe = slapos.cookbook:logrotate.d
name = resilient_log name = resilient_log
log = $${basedirectory:log}/resilient.log log = $${basedirectory:log}/resilient.log
frequency = weekly 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