Ema has uploaded a new change for review. https://gerrit.wikimedia.org/r/294077
Change subject: zerofetch: write output to logfile ...................................................................... zerofetch: write output to logfile Use a logfile (and rotate it) instead of cronspamming. Bug: T132835 Change-Id: I1a65cc6b287c5d174e1a28d6bdd9eb39477ebe2c --- A modules/varnish/files/zerofetch-logrotate A modules/varnish/files/zerofetch.rsyslog.conf M modules/varnish/manifests/zero_update.pp 3 files changed, 20 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/77/294077/1 diff --git a/modules/varnish/files/zerofetch-logrotate b/modules/varnish/files/zerofetch-logrotate new file mode 100644 index 0000000..395f4af --- /dev/null +++ b/modules/varnish/files/zerofetch-logrotate @@ -0,0 +1,6 @@ +/var/log/zerofecth.log { + rotate 7 + daily + compress + missingok +} diff --git a/modules/varnish/files/zerofetch.rsyslog.conf b/modules/varnish/files/zerofetch.rsyslog.conf new file mode 100644 index 0000000..f1d2d27 --- /dev/null +++ b/modules/varnish/files/zerofetch.rsyslog.conf @@ -0,0 +1,3 @@ +# NOTE: This file is managed by Puppet. + +if $programname == 'zerofetch' then /var/log/zerofetch.log diff --git a/modules/varnish/manifests/zero_update.pp b/modules/varnish/manifests/zero_update.pp index af47067..673bca6 100644 --- a/modules/varnish/manifests/zero_update.pp +++ b/modules/varnish/manifests/zero_update.pp @@ -38,7 +38,7 @@ require => File['/etc/zerofetcher'], } - $cmd = "/usr/share/varnish/zerofetch.py -s \"${site}\" -a /etc/zerofetcher/zerofetcher.auth -d /var/netmapper" + $cmd = "/usr/share/varnish/zerofetch.py -s \"${site}\" -a /etc/zerofetcher/zerofetcher.auth -d /var/netmapper 2>&1 | logger -t zerofetch" exec { 'zero_update_initial': user => 'netmap', @@ -57,4 +57,14 @@ hour => '*', require => File['/etc/zerofetcher/zerofetcher.auth'], } + + rsyslog::conf { 'zerofetch': + source => 'puppet:///modules/varnish/zerofetch.rsyslog.conf', + } + + # Rotate /var/log/zerofetch.log + logrotate::conf { 'zerofetch': + ensure => present, + source => 'puppet:///modules/varnish/zerofetch-logrotate', + } } -- To view, visit https://gerrit.wikimedia.org/r/294077 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1a65cc6b287c5d174e1a28d6bdd9eb39477ebe2c Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ema <e...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits