Commit 0f4fbd9a authored by Jérome Perrin's avatar Jérome Perrin

wip erp5 rsyslog

parent d1ea6223
......@@ -22,7 +22,7 @@ md5sum = 5784bea3bd608913769ff9a8afcccb68
[profile-caddy-frontend]
filename = instance-apache-frontend.cfg.in
md5sum = e7d7e1448b6420657e953026573311ca
md5sum = 743e58ba32be267afaeb0c62ad84c954
[profile-caddy-replicate]
filename = instance-apache-replicate.cfg.in
......
......@@ -817,7 +817,27 @@ caddy-log-directory = ${caddy-directory:slave-log}
[backend-haproxy-rsyslogd-configuration]
<= jinja2-template-base
template = ${software-release-path:template-backend-haproxy-rsyslogd-conf}
template = inline:
module(
load="imuxsock"
SysSock.Name="{{ configuration['log-socket'] }}")
# Just simply output the raw line without any additional information, as
# haproxy emits enough information by itself
# Also cut out first empty space in msg, which is related to rsyslogd
# internal and end up cutting on 8k, as it's default of $MaxMessageSize
template(name="rawoutput" type="string" string="%msg:2:8192%\n")
$ActionFileDefaultTemplate rawoutput
$FileCreateMode 0600
$DirCreateMode 0700
$Umask 0022
$WorkDirectory {{ configuration['spool-directory'] }}
{#- emit all not catched messages to full log file #}
*.* {{ configuration['log-file'] }}
rendered = ${directory:etc}/backend-haproxy-rsyslogd.conf
extra-context =
section configuration backend-haproxy-rsyslogd-config
......
......@@ -11,6 +11,7 @@ extends =
../../component/gzip/buildout.cfg
../../component/xz-utils/buildout.cfg
../../component/haproxy/buildout.cfg
../../component/rsyslogd/buildout.cfg
../../component/findutils/buildout.cfg
../../component/librsvg/buildout.cfg
../../component/imagemagick/buildout.cfg
......@@ -179,6 +180,7 @@ context =
key gzip_location gzip:location
key xz_utils_location xz-utils:location
key haproxy_location haproxy:location
key rsyslogd_location rsyslogd:location
key instance_common_cfg instance-common:rendered
key jsl_location jsl:location
key jupyter_enable_default erp5-defaults:jupyter-enable-default
......
......@@ -70,7 +70,7 @@ md5sum = cc19560b9400cecbd23064d55c501eec
[template]
filename = instance.cfg.in
md5sum = 5c5250112b87a3937f939028f9594b85
md5sum = 22619a2b75abcc8cc19bd46b585173ab
[monitor-template-dummy]
filename = dummy.cfg
......@@ -90,7 +90,7 @@ md5sum = 2f3ddd328ac1c375e483ecb2ef5ffb57
[template-balancer]
filename = instance-balancer.cfg.in
md5sum = 5b2d44397b5b03897c665b56325cdf79
md5sum = 2220ec6fadae05530b8322a19e82e7f1
[template-haproxy-cfg]
filename = haproxy.cfg.in
......
......@@ -202,10 +202,34 @@ extensions = jinja2.ext.do
[{{ section('haproxy') }}]
recipe = slapos.cookbook:wrapper
# TODO: can we change this to services-on-watch ? will it break resilience test ?
wrapper-path = ${directory:services}/haproxy
command-line = "{{ parameter_dict['haproxy'] }}/sbin/haproxy" -f "${haproxy-cfg:rendered}"
hash-files = ${haproxy-cfg:rendered}
[rsyslogd-config]
log-socket = ${directory:run}/log.sck
log-file = ${directory:log}/backend-haproxy.log
pid-file = ${directory:run}/rsyslogd.pid
spool-directory = ${directory:rsyslogd-spool}
graceful-command = kill -HUP $(cat ${:pid-file})
;caddy-log-directory = ${caddy-directory:slave-log}
[rsyslogd-config-file]
<= jinja2-template-base
template = inline: $ TODO {software-release-path:template-backend-haproxy-rsyslogd-conf}
rendered = ${directory:etc}/rsyslogd.conf
extra-context =
section configuration rsyslogd-config
[{{ section ('rsyslogd') }}]
recipe = slapos.cookbook:wrapper
command-line = {{ parameter_dict['rsyslogd'] }}/bin/rsyslogd -i ${rsyslogd-config:pid-file} -n -f ${rsyslogd-config-file:rendered}
wrapper-path = ${directory:services-on-watch}/rsyslogd
;hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
; TODO
[apache-conf-ssl]
cert = ${directory:apache-conf}/apache.crt
key = ${directory:apache-conf}/apache.pem
......@@ -320,6 +344,7 @@ run = ${:var}/run
log = ${:var}/log
srv = ${buildout:directory}/srv
apachedex = ${monitor-directory:private}/apachedex
rsyslogd-spool = ${:run}/rsyslogd-spool
[{{ section('resiliency-exclude-file') }}]
# Generate rdiff exclude file in case of resiliency
......
......@@ -59,6 +59,7 @@ openssl-location = {{ openssl_location }}
apache = {{ apache_location }}
openssl = {{ openssl_location }}
haproxy = {{ haproxy_location }}
rsyslogd = {{ rsyslogd_location }}
apachedex-location = {{ bin_directory }}/apachedex
run-apachedex-location = {{ bin_directory }}/runApacheDex
promise-check-apachedex-result = {{ bin_directory }}/check-apachedex-result
......
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